| title | DevIntern Code Configuration |
|---|---|
| sidebarLabel | Configuration |
| description | Use when setting up the .env file, choosing a task tracker, connecting GitHub or Bitbucket, or finding the page for agent, sandbox, and advanced settings in DevIntern Code. |
| section | Automation Reference |
| order | 0 |
| dateModified | 2026-11-26 |
DevIntern Code keeps its settings in ~/.devintern, outside your repositories. devintern init registers the current repository in ~/.devintern/workspace.toml (as a manual_only repo, which the worker skips) and writes its settings to ~/.devintern/env/<repo>.env. To let the worker run tasks there too, run devintern worker init or devintern worker add-repo in the checkout: either one turns the manual-only entry into a worker repository. Each repository has its own file, so several projects can use different trackers and credentials. A repository without a GitHub, GitLab, or Bitbucket origin (for example a fresh git init) is registered by its directory instead.
In a terminal, devintern init first asks how you want to run tickets: automatically with a worker (recommended, the same wizard as devintern worker init) or by hand from this terminal. For manual runs the wizard asks which tracker you use, links to the provider's token page, checks the credentials, and writes the file. With --yes (or --no-interactive), or when stdin is not a terminal, it writes a commented template for you to fill in instead. Run devintern init again in the repository to update the file; a repository already set up for manual runs goes straight to that update.
Older releases kept settings in the repository's .devintern-code/ folder. The first time this release runs in such a repository (any devintern task run or devintern init), it moves them automatically:
.devintern-code/.envbecomes~/.devintern/env/<repo>.env, and the repository is registered as amanual_onlyrepo.- Your sign-in moves to
~/.devintern/state/code/. - Status names from
.devintern-code/settings.jsonare copied to[trackers]in~/.devintern/workspace.toml. The worker does the same for the repositories it runs when it starts.
Committed files (settings.json, .env.example) are left in place; delete them from the repository once everyone has upgraded. Past manual run history is not carried over.
More settings:
- Agent Harness: which AI agent runs, models, reasoning effort, failover, per-task overrides.
- Sandboxing the Agent: confining agent runs with
native,nono, or Docker Sandboxes. - Advanced Settings: timeouts, auto-review, logging, telemetry, output directory, prompt overrides, tracker status settings, and
devintern doctor.
In a repository registered in ~/.devintern/workspace.toml, settings come from the workspace: the shared ~/.devintern/.env, then the repo's env_file and [repos.env] (see Workspaces); --env-file still applies on top. Otherwise DevIntern looks for .env in this order and uses the first match: --env-file <path>, then .env in the current directory and each parent up to the git root, then ~/.env, then the tool's install directory. This means you can run devintern from any subdirectory of the project. With --env-file, only that file is loaded. Values in the file override variables already set in your shell.
Set TASK_TRACKER to pick the tracker. The default is jira.
TASK_TRACKER |
Credentials and setup |
|---|---|
jira |
Jira Integration |
linear |
Linear Integration |
trello |
Trello Integration |
asana |
Asana Integration |
azure-devops |
Azure DevOps Integration |
github |
GitHub Issues Integration |
gitlab |
GitLab Integration |
markdown |
Markdown File Tasks (no credentials) |
# Example: Jira
JIRA_BASE_URL=https://yourcompany.atlassian.net
JIRA_EMAIL=you@company.com
JIRA_API_TOKEN=your-api-tokenStatus transitions and story-point fields go in [trackers] in workspace.toml; see Tracker status settings.
Set GITHUB_TOKEN for CLI runs and for workspace automation. A workspace paired with the hosted relay receives events through the central DevIntern AI App; the token stays on your machine and you don't create a GitHub App yourself. Unattended runs also need the Worker Pilot or a LICENSE_KEY (pricing).
If GITHUB_TOKEN is unset and the GitHub CLI is signed in, devintern init and devintern worker init offer to use gh auth token instead of asking you to create a token; worker init --non-interactive uses it automatically. Setup validates it with the same repository-access probe as a pasted token and never saves one the probe rejects. For the GitHub tracker a rejected token stops non-interactive setup with the fix-credentials next step. For any other tracker it is only the optional PR token, so setup warns and continues — unless the repository check itself needs that token, such as a private HTTPS GitHub remote; then setup fails and restores the files it wrote. In the wizard it falls back to asking for a token, as it does when gh is missing or signed out. CI status access is checked separately by worker doctor when auto-merge or automatic CI fixes need it.
The saved token is a copy for DevIntern alone. It does not change when gh re-authenticates or when you sign in to a different GitHub account. To update it, replace GITHUB_TOKEN in the workspace .env (~/.devintern/.env) or the repo's env file under ~/.devintern/env/, or re-run setup with a fresh token in an env file passed with --env-file.
| What you want | Need |
|---|---|
| Implement tickets and open PRs from the CLI | GITHUB_TOKEN |
GitHub Issues as the task tracker (TASK_TRACKER=github) |
GITHUB_TOKEN (an App cannot substitute) |
| Worker review polling and replies | GITHUB_TOKEN |
@devintern-ai on any PR |
GITHUB_TOKEN + relay + DevIntern AI App installation |
Air-gapped mentions, devintern webhook serve, or custom slug[bot] attribution |
Customer-owned GitHub App (below) |
Token permissions. Use either kind of personal access token:
| Token | Create it at | Grant |
|---|---|---|
| Fine-grained (recommended) | github.com/settings/personal-access-tokens/new | Repository access: only the repositories the worker uses. Repository permissions: Contents, Pull requests, and Issues set to Read and write; Metadata Read (added automatically) |
| Classic | github.com/settings/tokens/new?scopes=repo | The repo scope |
Issues lets the worker read, label, and comment on issues when GitHub Issues is your tracker (TASK_TRACKER=github). Add Commit statuses set to Read when [workspace].auto_merge = true (auto-merge reads every PR's CI checks, including PRs that only touch safe paths) or ci_failure_fix = true, and Actions set to Read too when ci_failure_fix = true. Without Commit statuses Read on a private repository, auto-merge never merges and CI fixes never start. Fine-grained tokens can't be granted Checks and don't need it; status comments then report check runs by count instead of by name, while a GitHub App or a classic token can read their names. devintern worker doctor reports a missing permission in its CI status access row, and the worker warns at startup. A fine-grained token for an organization's repositories may need approval by an organization owner before it works; set Resource owner to that organization.
Contentsmust be Read and write. With read-only Contents, task fetching and PR reads work butgit pushfails with403. Forhttps://github.comremotes, clones, fetches, and pushes useGITHUB_TOKENwhen git has no credential helper of its own; the token is passed to git in memory, never written to.git/configor a remote URL. A configured helper (for examplegh auth setup-gitor a keychain) is used instead, andghitself serves an exportedGITHUB_TOKENahead of its keyring login. SSH remotes use your SSH keys. The worker test-pushes each GitHub HTTPS remote at startup and warns if the push is rejected.
Bot aliases. Relay-backed workspaces recognize @devintern-ai automatically. To treat other bot logins as mentions too, set GITHUB_BOT_ALIASES to a comma-separated list (with or without the [bot] suffix).
Use your own GitHub App only when you can't use the relay (for example, an air-gapped installation) or when you run devintern webhook serve against your own endpoint. It provides the bot identity for @mention matching and custom slug[bot] attribution.
GITHUB_APP_ID=123456
GITHUB_APP_PRIVATE_KEY_PATH=/secure/path/to/your-app.private-key.pem
# or, for CI: GITHUB_APP_PRIVATE_KEY_BASE64=$(base64 -w 0 your-app.private-key.pem)You need both the ID and a private key. An ID on its own does nothing. Create the App under Settings → Developer settings → GitHub Apps with repository permissions Contents, Pull requests, and Issues set to Read and write, plus Commit statuses and Checks set to Read if auto-merge or automatic CI fixes are on, and Actions set to Read for CI fixes. Generate a private key and install the App on your repositories. The webhook server needs more permissions; see GitHub Webhooks and PR Automation.
When both a token and an App are configured, relay workspaces use only GITHUB_TOKEN, no-relay workspaces and devintern webhook serve prefer the App, and the CLI prefers GITHUB_TOKEN when it creates PRs.
BITBUCKET_TOKEN=your-bitbucket-tokenNeeds the Repositories: Write permission. Create it at bitbucket.org/account/settings/app-passwords.
DevIntern commits with whatever identity git already has on the host (git config user.name / user.email, or GIT_AUTHOR_* / GIT_COMMITTER_* in the environment) and never changes it. On a fresh machine with no git identity, it does not write any git config. Each commit uses the first identity found here:
| Source | Identity |
|---|---|
git_author_name + git_author_email |
The values you set (below) |
GITHUB_TOKEN |
The token's GitHub user: display name (or login) and <id>+<login>@users.noreply.github.com |
| GitLab code-host token | The token's GitLab user and its commit email |
| Nothing set | DevIntern <devintern@users.noreply.github.com>, with a warning in the log |
To pick the identity yourself, set both keys in workspace.toml. A [[repos]] entry can override the [workspace] values:
[workspace]
git_author_name = "Acme DevIntern"
git_author_email = "devintern@acme.example"For runs outside a workspace, set DEVINTERN_GIT_AUTHOR_NAME and DEVINTERN_GIT_AUTHOR_EMAIL in .env. The customer-owned GitHub App mode commits as slug[bot] instead. devintern worker doctor shows the identity in its Git commit identity row.
AGENT_HARNESS selects the AI agent CLI. The default is claude-code. A comma-separated list such as claude-code,codex makes the worker switch to the next agent when one hits a usage limit. For models, effort, CLI paths, and per-harness notes, see Agent Harness.
Agents run with their permission prompts turned off, so by default they can do anything your user account can. Set AGENT_SANDBOX=auto (or pass --sandbox <provider>) to run every agent inside an OS-level sandbox. Run devintern sandbox to see which providers are installed. See Sandboxing the Agent.
The agent can write to the working directory, the task output directory, the temp directory, browser caches, and its own state directories. Everything else is read-only, and network access is open by default. See What the sandbox allows for the full list and the variables that change it.
A globally installed devintern checks npm for a newer version at most once a day.
| Mode | Behavior |
|---|---|
| Interactive terminal | Asks Update? (Y/n), installs, and re-runs your command |
| Non-interactive (CI, workers, scripts) | Doesn't install. Prints a one-line notice |
| Opt out | DEVINTERN_NO_UPDATE=1 or --no-update |
| Always auto-install (even non-interactive) | DEVINTERN_AUTO_UPDATE=1 |
Only global npm or bun installs are updated. To upgrade now, run bun install -g @getdevintern/code@latest (or npm install -g ...). To force a fresh check, delete ~/.devintern/update-check.json.
Run devintern doctor first: it checks the runtime, agent CLI, tracker credentials, sign-in, and license, and gives a fix for each failure (details).
- "Missing required environment variables": make sure
~/.devintern/env/<repo>.envexists (rundevintern initin the repository) and the variable names are spelled exactly right (they are case-sensitive). - "Not in a git repository": run
git init, or pass--no-git. <Harness> CLI not found: install the agent CLI and put it on yourPATH, or setAGENT_CLI_PATH/--agent-path.- "Unknown agent harness": check how
AGENT_HARNESSis spelled (kebab-case, for exampleclaude-code,deepseek,reasonix). The error message lists every valid name. - "GitHub rejected GITHUB_TOKEN (HTTP 401)": the token is mistyped, expired, or revoked. Create a new one (see GitHub authentication) and replace
GITHUB_TOKEN. In the setup wizard, edit values asks for a new token instead of offering to keep the rejected one. - "GITHUB_TOKEN has no access to
owner/repo": the token works but can't see that repository. CheckGITHUB_REPO, then add the repository under the fine-grained token's Repository access (or use a classic token with thereposcope). An organization may need to approve the token first. - Push fails with
403: your token needsContents: Read and write(see GitHub authentication).
If something looks like a DevIntern bug rather than a configuration problem, file it with devintern report (Reporting bugs).