Workspace
class Workspace extends AbstractObject implements IdAble, Node
A Dagger workspace detected from the current working directory or constructed from a Directory.
Properties
| $lastQuery | from AbstractObject |
Methods
No description
Canonical Dagger address of the workspace location, or an opaque identity for synthetic workspaces.
Return all checks from modules loaded in the workspace.
Regenerate all generated API clients registered in workspace config and return the resulting Changeset.
Plan the workspace changes for initializing a generated API client: generated client files at path plus a [[modules.
Selected native workspace config file relative to the workspace root, if any.
Read a configuration value from dagger.toml.
Write a configuration value to dagger.toml.
Current location within the workspace root.
Returns a Directory from the workspace.
Create a named workspace environment if it does not already exist.
List named environments defined in the workspace configuration.
Remove a named workspace environment.
Search for a file or directory by walking up from the start path within the workspace.
Return all generators from modules loaded in the workspace.
Git state for this workspace. Errors if the workspace is not in a git repository.
Initialize workspace config, creating dagger.toml.
Install a module into the workspace, writing dagger.toml to the host.
Plan the explicit migration needed for the current workspace.
Plan the workspace changes for initializing a new module: dagger-module.toml + SDK codegen output at path, the authoring entry under [[modules.
List modules defined in the workspace configuration.
Return all services from modules loaded in the workspace.
Uninstall a module from the workspace, writing dagger.toml to the host.
Return this workspace with a changeset applied, without mutating the source.
Return this workspace with a directory added, without mutating the source.
Return this workspace with a new or replaced file, without mutating the source.
Details
in
AbstractObject at line 13
__construct(AbstractClient $client, QueryBuilderChain $queryBuilderChain)
No description
in
AbstractObject at line 19
protected null|array|string|int|float|bool
queryLeaf(QueryBuilder $leafQueryBuilder, string $leafKey)
No description
at line 19
string
address()
Canonical Dagger address of the workspace location, or an opaque identity for synthetic workspaces.
at line 28
Changeset
changes(Workspace $other)
Return the changes from another workspace to this workspace.
at line 38
CheckGroup
checks(array|null $include = null, array|null $skip = null, bool|null $noGenerate = null, bool|null $onlyGenerate = null)
Return all checks from modules loaded in the workspace.
at line 63
Changeset
clientGenerate()
Regenerate all generated API clients registered in workspace config and return the resulting Changeset.
at line 72
Changeset
clientInit(string $path, string $sdk, string $module, bool|null $here = false, Json|null $args = null)
Plan the workspace changes for initializing a generated API client: generated client files at path plus a [[modules.
at line 95
string
configFile()
Selected native workspace config file relative to the workspace root, if any.
at line 110
string
configRead(string|null $key = '')
Read a configuration value from dagger.toml.
If key is empty, returns the full config.
If key points to a scalar, returns the value.
If key points to a table, returns flattened dotted-key output.
at line 122
string
configWrite(string $key, string $value, bool|null $here = false)
Write a configuration value to dagger.toml.
at line 140
string
cwd()
Current location within the workspace root.
The workspace root is returned as "/".
Relative paths in workspace APIs resolve from here.
at line 151
Directory
directory(string $path, array|null $exclude = [], array|null $include = [], bool|null $gitignore = false)
Returns a Directory from the workspace.
Relative paths resolve from the workspace cwd. Absolute paths resolve from the workspace root.
at line 174
string
envCreate(string $name, bool|null $here = false)
Create a named workspace environment if it does not already exist.
at line 187
array
envList()
List named environments defined in the workspace configuration.
at line 196
string
envRemove(string $name, bool|null $here = false)
Remove a named workspace environment.
at line 211
File
file(string $path)
Returns a File from the workspace.
Relative paths resolve from the workspace cwd. Absolute paths resolve from the workspace root.
at line 227
string
findUp(string $name, string|null $from = '.')
Search for a file or directory by walking up from the start path within the workspace.
Returns the absolute workspace path if found, or null if not found.
Relative start paths resolve from the workspace cwd.
The search stops at the workspace root and will not traverse above it.
at line 240
GeneratorGroup
generators(array|null $include = null)
Return all generators from modules loaded in the workspace.
at line 252
WorkspaceGit
git()
Git state for this workspace. Errors if the workspace is not in a git repository.
at line 261
Id
id()
A unique identifier for this Workspace.
at line 270
string
init(bool|null $here = false)
Initialize workspace config, creating dagger.toml.
at line 282
string
install(string $ref, string|null $name = '', bool|null $here = false, bool|null $asSdk = false, string|null $asSdkName = '')
Install a module into the workspace, writing dagger.toml to the host.
at line 311
WorkspaceMigration
migrate()
Plan the explicit migration needed for the current workspace.
The returned plan has an empty changeset and no steps when no migration is needed.
at line 320
Changeset
moduleInit(string $name, string|null $sdk = '', string|null $path = '', string|null $source = '', array|null $include = [], bool|null $here = false, Json|null $args = null)
Plan the workspace changes for initializing a new module: dagger-module.toml + SDK codegen output at path, the authoring entry under [[modules.
at line 355
array
moduleList(string|null $module = '')
List modules defined in the workspace configuration.
at line 367
UpGroup
services(array|null $include = null)
Return all services from modules loaded in the workspace.
at line 379
string
uninstall(string $name, bool|null $here = false)
Uninstall a module from the workspace, writing dagger.toml to the host.
at line 394
Changeset
update()
Refresh workspace-managed state and return the resulting changeset.
Currently this refreshes existing lockfile entries only.
at line 403
Workspace
withChanges(Changeset $changes)
Return this workspace with a changeset applied, without mutating the source.
at line 413
Workspace
withNewDirectory(string $path, Directory $source)
Return this workspace with a directory added, without mutating the source.
at line 424
Workspace
withNewFile(string $path, string $contents, int|null $permissions = 420)
Return this workspace with a new or replaced file, without mutating the source.