For AI agents: a documentation index is available at https://www.mongodb.com/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.
Docs Menu

agentengine init

Bootstrap org, project, and workspace for this agent repo.

Select an organization and project, generate local dev files (.agentengine/ runtime artifacts and .devcontainer/devcontainer.json), and register this agent as a workspace.

The menus list only organizations and projects where you can create a workspace, and say how many they hid. To target a project you can only view, run agentengine context create instead. A project passed with --project-id, --context, or --workspace-id is checked the same way before init writes anything.

With Atlas IAM delegation off, the org and project menus can also create an Agent Engine organization or project. With delegation on, init selects an existing organization: create or join in Atlas and re-run init. It still offers Agent Engine project create under an Agent Engine organization.

The workspace ID is saved to .agentengine/state.json under the bound context, so later agentengine build commands need no --workspace-id.

Without --context, init selects a project and then reuses that project’s context or creates one named after the project’s display name and ID.

--org-id and --project-id skip the interactive menus; omitting either falls back to interactive selection for that value. --workspace-id links this directory to an existing workspace without creating one, which recovers a run that failed after the platform created the workspace.

Existing generated files are preserved. Re-running init registers the workspace again and refreshes its binding to the selected context.

agentengine init [flags]
agentengine init
agentengine init --context prod --workspace-id ws_789 --org-id org_123 --project-id grp_456
--base-url string Platform API base URL override
--context string Named context to bind this directory to
-h, --help help for init
--json Output init result as JSON
--org-id string Organization ID to use without prompting
--project-id string Project ID to use without prompting
--workspace-id string Link to an existing workspace instead of creating one
-y, --yes Skip the confirmation prompt when re-pinning this directory to a different context
--log-file string override log file path
--log-level string file log verbosity (error|warn|info|debug) (default "info")
--no-log disable file logging
-q, --quiet silence stderr below error
-v, --verbose count raise stderr verbosity (-v info, -vv debug)
Rate this page