Skip to content

feat(agentctl): agentctl setup, from nothing to a running agent - #359

Open
elsand wants to merge 4 commits into
mainfrom
feat/agentctl-setup
Open

elsand wants to merge 4 commits into
mainfrom
feat/agentctl-setup

Conversation

@elsand

@elsand elsand commented Oct 29, 2026 •

Copy link
Copy Markdown

agentctl setup takes you from an installed agentctl to a running agent, connected to your editor if you like. A newcomer answers a few questions with defaults. Every question also has a flag, and setup ends by printing the command that repeats the same setup without questions. This is an alternative to the onboarding stack in #309–#320.

  • Where an agent comes from. A standard agent from agents/standard/, which the build embeds in agentctl. A team's agent from a path or a GitHub address, fetched into a temporary checkout. When its manifest mounts its own repository, as Altinn's worktree variant does, setup mounts a checkout on this machine there. Or an agent set up before, which setup offers first with what fits its state.
  • No harness or gh on the host. Claude Code, Codex and GitHub sign in inside a short-lived sandbox of the base image. agentd keeps the credential, and the agent sees only placeholders. Logins agentctl holds and GitHub accounts other agents use are offered for reuse.
  • One folder per agent. ~/agents/<name>/ holds the manifest, the files it reads and its .env. Replacing a definition asks first and swaps the whole folder.
  • A first standard agent, dotnet-backend-developer: .NET 8 and 10, Podman, docker and Docker Compose. When its image cannot be pulled, setup offers to build it here from the Dockerfile agentctl carries.
  • The installers start setup after a first managed install, not on upgrades or standalone installs.
  • Fix: SSH and vnc-info commands now name the control-plane home, so they reach agents on a home other than the default.

The four commits review one at a time: the sign-in primitives, the SSH and VNC fix, the standard agent, and setup.

Try it

Comment /agentctl-experimental for an installable build and install it as the reply says. You have agentctl already, so the installer does not start setup. Run it on a home of its own, so your agents stay as they are:

agentctl --home ~/.agent-try setup
  • Pick the standard agent. Its image is published once this merges, so for now setup offers to build it here, which needs Docker. On macOS it offers to install Colima.
  • Or a team's agent, with --from https://github.com/Altinn/altinn-studio//agents/minimal.
  • Move with the arrow keys, press Esc to go back, and run the command setup prints at the end.
  • Run setup again. It offers the agent you made.

Clean up with agentctl --home ~/.agent-try delete agent/<name> and rm -rf ~/agents/<name>, since the folder lives in ~/agents whichever home you use.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dd4b864b-0f12-4d2f-a39a-34dad5c85979

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread agentctl/src/bin/agentctl/setup/answers.rs Dismissed
Comment thread agentctl/src/bin/agentctl/setup/mod.rs Fixed
Comment thread agentctl/src/bin/agentctl/setup/mod.rs Fixed
Comment thread agentctl/src/bin/agentctl/setup/mod.rs Fixed
Comment thread agentctl/src/bin/agentctl/setup/mod.rs Fixed
Comment thread agentctl/src/bin/agentctl/setup/mod.rs Fixed
Comment thread agentctl/src/bin/agentctl/setup/mod.rs Fixed
Comment thread agentctl/src/bin/agentctl/setup/mod.rs Fixed
Comment thread agentctl/src/bin/agentctl/setup/mod.rs Fixed
Comment thread agentctl/src/bin/agentctl/setup/sign_in.rs Dismissed
@elsand
elsand force-pushed the feat/agentctl-setup branch 5 times, most recently from 9a0f001 to d65e6db Compare October 29, 2026 08:48
Comment thread agentctl/src/bin/agentctl/setup/mod.rs Fixed
@elsand
elsand force-pushed the feat/agentctl-setup branch from d65e6db to 62e61ca Compare October 29, 2026 09:00
@digdir digdir deleted a comment from github-actions Bot Oct 29, 2026
@elsand
elsand force-pushed the feat/agentctl-setup branch from 62e61ca to 73e2747 Compare October 29, 2026 12:26
Comment thread agentctl/src/bin/agentctl/prompt.rs Dismissed
Comment thread agentctl/src/bin/agentctl/prompt.rs Dismissed
Comment thread agentctl/src/bin/agentctl/setup/create.rs Dismissed
Comment thread agentctl/src/bin/agentctl/setup/create.rs Dismissed
Comment thread agentctl/src/bin/agentctl/setup/create.rs Dismissed
Comment thread agentctl/src/bin/agentctl/setup/create.rs Dismissed
Comment thread agentctl/src/bin/agentctl/setup/create.rs Dismissed
Comment thread agentctl/src/bin/agentctl/setup/create.rs Dismissed
Comment thread agentctl/src/bin/agentctl/setup/github.rs Dismissed
@digdir digdir deleted a comment from github-actions Bot Oct 29, 2026
elsand and others added 4 commits October 29, 2026 19:26
`agentctl setup` will sign people in to Claude Code, Codex and GitHub without
those tools on the host. It runs each sign-in in a sandbox of the base image,
relays its terminal, and opens the sign-in page in the host's browser. This
adds the library side that it builds on.

- `sandbox::start_terminal_execution` starts a terminal Execution that the
  caller relays itself, so it can scan the output as well as show it.
- `harness::sandbox_sign_in` and `harness::github::sign_in` describe each
  sign-in: the program to run, the file it leaves its credential in, and how
  to read the credential once it exits.
- Claude's sign-in wraps its token at the terminal width, ending a row with a
  newline or with cursor movements. The token parser reads it off the screen
  the output draws, so it joins the rows the token fills either way.
- `harness::sign_in_links` finds the sign-in pages in output as it arrives.
  It accepts only those pages, so a program cannot send the browser
  elsewhere. A link still arriving is left out until it ends.
- `authentication.v1.status` reports which harness logins the daemon holds.
  The protocol version stays the same, because a client already requires
  the daemon's exact build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The SSH configuration agentd writes reaches each agent through a
ProxyCommand that runs agentctl. It named no control-plane home, so for an
agent on another home than the default, such as one chosen with `--home`,
`ssh agentctl-<name>`, `agentctl ssh` and editors connecting over SSH asked
the default home's agentd and found no such agent. The ProxyCommand now
passes `--home`, quoted for the shell OpenSSH runs it with, and the
forwarding command `agentctl vnc-info` prints does the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`agentctl setup` will offer standard agents to start from. This adds the
first, dotnet-backend-developer, with the catalog that describes the
standard agents to the setup wizard and the KI-hub directory site.

The agent references a published image, so its host needs no Docker.
The image adds the .NET SDKs 8.0 and 10.0 as Ubuntu packages, and the
containers feature: Podman with the `docker` command, Docker Compose and
a Docker API socket that clients find without configuration. Ubuntu
26.04 carries only .NET 10, so .NET 8 comes from the backports archive
of Canonical's .NET team, whose signing key sits beside the Dockerfile.
CI builds it on the base image from the same commit, which is why its
FROM names the base tag without a digest, and publishes it from main. It
shares one workflow with the self-dev images, which differed from it only
in the images they name.

The manifest has no tmpfs at /tmp, since the base now keeps /tmp on the
sandbox disk, and GITHUB_TOKEN is optional so the agent starts without
GitHub access.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Getting a first agent took a hand-written manifest, the harnesses and
`gh` installed on the host to sign in, a `.env` of tokens, and SSH wired
up for an editor. `agentctl setup` does all of it in one wizard that a
newcomer can answer with defaults and that every flag can answer for a
script. The installers start it after a first managed install, unless
`AGENT_SETUP=0`. An upgrade has agents already, and a standalone install
is for images and CI jobs, so neither starts it.

- Sources: a standard agent from the catalog, which the build embeds in
  agentctl so it works offline and matches its manifest schema; a team's
  agent on disk or on GitHub, fetched into a temporary checkout; or an
  agent set up before in ~/agents, offered with what fits its state. A
  manifest that mounts its own repository, by a relative source such as
  `../..`, mounts a checkout on this machine there, asked for when the
  manifest was fetched.
- Each agent gets a folder of its own, ~/agents/<name>, holding its
  manifest, the files it reads and its `.env`. Replacing one asks first,
  and removes the old folder and agent before the new one takes its place,
  so no definition ends up mixed.
- Sign-ins run in a short-lived sandbox, so the host needs no harness or
  `gh`, and the agent only ever sees placeholders. The sandbox has no
  clipboard, so the host copies GitHub's one-time code to its own. A
  harness login agentd holds and a GitHub account another agent uses are
  offered for reuse.
- A standard agent whose image cannot be pulled, as before it is
  published, can be built here from the Dockerfile agentctl carries.
- The review offers the manifest in an editor, for everything the
  questions leave at its recommended value, such as an exact size, the
  model or hosts the agent may not reach.
- Questions take the arrow keys, Esc goes back by replaying the answers
  before it, and setup ends by printing the command that repeats it
  without questions.
- Leftovers of a setup that ends early, its staging folder and sign-in
  agent, are removed by the next run; `get` and the TUI hide sign-in
  agents.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@elsand
elsand force-pushed the feat/agentctl-setup branch from 73e2747 to 30f4e84 Compare October 29, 2026 18:49
@elsand

elsand commented Oct 29, 2026

Copy link
Copy Markdown
Author

/agentctl-experimental

@github-actions

Copy link
Copy Markdown

Experimental agentctl v0.1.0-preview.13.experimental.pr359.4 is built from 30f4e84. Its archives are the artifacts of this run, deleted when this pull request closes.

Install it on macOS or Linux, with platform one of macos-aarch64, linux-x86_64 or linux-aarch64:

platform=macos-aarch64
gh run download 40936043351 --repo digdir/digdir-agents --name "agent-${platform}" --dir agentctl-experimental
curl -fsSL https://raw.githubusercontent.com/digdir/digdir-agents/30f4e843eeabf24719e442d99670c2b528a7478a/agentctl/install.sh \
  | AGENT_VERSION=v0.1.0-preview.13.experimental.pr359.4 AGENT_LOCAL_ARCHIVE="${PWD}/agentctl-experimental/agent-${platform}.tar.gz" sh

On Windows, with $Platform one of windows-x86_64 or windows-aarch64:

$Platform = 'windows-x86_64'
gh run download 40936043351 --repo digdir/digdir-agents --name "agent-$Platform" --dir agentctl-experimental
$env:AGENT_VERSION = 'v0.1.0-preview.13.experimental.pr359.4'
$env:AGENT_LOCAL_ARCHIVE = "$PWD\agentctl-experimental\agent-$Platform.tar.gz"
irm https://raw.githubusercontent.com/digdir/digdir-agents/30f4e843eeabf24719e442d99670c2b528a7478a/agentctl/install.ps1 | iex
Remove-Item Env:AGENT_VERSION, Env:AGENT_LOCAL_ARCHIVE

Without the GitHub CLI, download agent-<platform> from the run page instead, unzip it into agentctl-experimental and skip the gh run download line.

agentctl self update returns to the latest release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants