Skip to content

feat: one-command onboarding (axl install, login, enrollment, status, service) - #7

Merged
mariomeyer merged 41 commits into
mainfrom
feat/onboarding
Nov 28, 2026
Merged

mariomeyer merged 41 commits into
mainfrom
feat/onboarding

Conversation

@mariomeyer

Copy link
Copy Markdown
Member

Getting a machine onto Axle used to mean minting a token on the server and hand-editing each harness's config. This makes it one command.

What's new

  • axl install: detects Claude Code, Codex and OpenCode and sets each one up (MCP bridge, hooks, instructions). It can be re-run safely, adopts hand-made setups from the old docs, keeps backups, and records everything in ~/.axl/install-manifest.json. With no server configured it asks whether to run Axle locally (a launchd/systemd user service) or connect to a server, and logs in when needed. --dry-run shows the diff and writes nothing.
    • Claude Code: an Axle-owned plugin linked into ~/.claude/skills/axle, with a user-scope fallback.
    • Codex: [mcp_servers.axle], a hooks block between # >>> axle >>> markers, and an AGENTS.md block. axl hook now understands Codex payloads (--harness codex).
    • OpenCode: mcp.axle (JSONC comments preserved, otherwise a manual-step snippet) and an AGENTS.md block.
  • Connect a machine (Tokens page): creates a one-time code (15 min, single use, stored hashed) and shows curl -fsSL https://<server>/install.sh | sh -s -- <CODE>.
  • axl login <url>: browser approval (device flow) at /ui/connect, or --code. axl logout [--revoke].
  • axl status: one screen covering server, token, service and each harness, with the fix command for every problem.
  • axl service: install/start/stop/restart/status/logs for the local server.
  • axl uninstall [--service [--purge]] [--revoke]: removes exactly what install recorded.
  • Server:
    • /v1/enroll, /v1/login/{start,poll}, /v1/whoami, /v1/token/revoke and GET /install.sh
    • a per-IP limit (10/min) on the unauthenticated endpoints
    • AXL_PUBLIC_URL (Helm publicUrl) and AXL_TRUSTED_PROXY_HEADER
    • migration 0003_enrollment for SQLite and Postgres
  • CI: shellcheck for the install script.
  • Docs: new docs/cli.md, updated quickstart, harness guides, security, configuration, HTTP API and deploy docs.

Design: docs/superpowers/specs/2026-11-27-onboarding-design.md. Plan: docs/superpowers/plans/2026-11-27-onboarding.md.

Testing

  • cargo test --features pg-tests: 496 passed, on SQLite and Postgres.
    • golden-fixture tests for every harness editor (unrelated config survives, idempotent re-run, uninstall round trip)
    • an end-to-end run of the real binary: serve → enroll → install (dry and real), with no token in any output
    • install.sh checked with shellcheck and run under dash
  • clippy -D warnings, fmt and tests/helm.sh are clean.
  • Not exercised for real: live Claude Code / Codex / OpenCode sessions loading the generated config, and real launchd/systemd. These are covered by the documented formats and recorded command sequences.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-28T00:09:07.382299Z 1311dd8 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c6f55a5fea

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/daemon/mod.rs Outdated
Comment on lines +168 to +170
if port != DEFAULT_PORT {
cfg.port = Some(port);
cfg.server_url = Some(format!("http://127.0.0.1:{port}"));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve remote server URLs when saving a local service port

If a machine is already logged in to a remote server, running axl service install --port 8000 unconditionally replaces its saved server_url with the local address while retaining the remote server's token. Subsequent bridges and hooks therefore connect to the local database with an invalid credential, breaking the existing remote setup. Preserve an explicitly configured remote URL here; only update the client URL when it is unset or points to the previous local service.

Useful? React with 👍 / 👎.

Comment thread src/cli/status.rs Outdated
Some(fix),
));
}
Err(e) => lines.push(line("token", format!("could not check ({e})"), None)),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Mark failed token checks as an unsuccessful status

If /readyz succeeds but the subsequent /v1/whoami request times out or loses its connection, this branch reports that the token could not be checked without attaching a fix. Since status_with calculates success solely from whether any line has a fix, an otherwise configured machine then returns exit code 0 despite never establishing that its token works. Mark this outcome unsuccessful and provide a retry action so scripts and the onboarding installer do not treat an incomplete authentication check as success.

Useful? React with 👍 / 👎.

@mariomeyer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6ed4522720

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/cli/install.rs Outdated
Comment on lines +227 to +228
if has_token && current == url {
if args.code.is_some() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Validate the saved token before skipping enrollment

If the saved token has been revoked, or the server database has been replaced at the same URL, the UI's axl install --server URL --code CODE command cannot reconnect the machine: this branch treats the presence of any token file as proof of authentication and skips the new code, even with --force. Since check_server only calls the unauthenticated /readyz endpoint, installation can report success while every bridge remains unauthorized. Check the saved token with whoami before taking this shortcut, and allow enrollment when the server rejects it.

Useful? React with 👍 / 👎.

@mariomeyer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3f22cb163b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/daemon/mod.rs Outdated
Comment on lines +154 to +155
let running = matches!(ctl.status(), Ok(ServiceState::Running));
if !running && !port_free(spec.port) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Check port availability when changing a running service's port

If Axle is already running on port 7420 and another process holds port 8000, axl service install --port 8000 skips this check merely because the existing service is running. Both service implementations then replace the configuration and restart Axle, which cannot bind the occupied port, taking a working server offline. Only bypass the availability check when the requested port is the one the running service currently uses; reject an occupied replacement port before modifying or restarting the service.

Useful? React with 👍 / 👎.

@mariomeyer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 1311dd8ae2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@mariomeyer
mariomeyer merged commit 23e1293 into main Nov 28, 2026
10 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant