Skip to content

Edit agent configs' setup commands in the console, and document them - #206

Merged
jinxi97 merged 3 commits into
mainfrom
jinxi97/monid-ai/cli-api-key-setup-v3
Oct 26, 2026
Merged

jinxi97 merged 3 commits into
mainfrom
jinxi97/monid-ai/cli-api-key-setup-v3

Conversation

@jinxi97

@jinxi97 jinxi97 commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Last PR for setup commands, after #203 (core schema), #204 (configs store them) and #205 (E2B runs them in the template build).

Console:

  • The create and edit dialogs get a Setup commands field (components/SetupCommandsFields.tsx).
    • One card per command, in run order, each a monospace textarea. It's sized to its command plus a spare row, up to 8 rows, so a heredoc shows whole.
    • The cards reuse the credentials field's look, so the two lists in one dialog read alike.
  • A blank card holds Create or Save back, the same way an empty credential field does. The api refuses blank commands anyway.
  • The edit dialog sends setupCommands only when the list changed (lib/setup-commands.ts, sameSetupCommands). An edit to another field carries the list forward.
  • Quick Start still sends []. It stays the short path, as it does for credentials.

README: a short "Setup commands" section: a one-line example (echo 'hello world' > ~/hello.txt) and three bullets. Commands run in order, each in its own shell, as the sandbox user. They run once per build, so they see no credentials. A failing command ends the run and is named, so downloads should retry on their own.

The Credentials section's stand-in-key bullet now links to this section for tools that keep their key in a file.

Verified in a browser: headless Chrome driven over CDP, against the real api (buildApp) on an in-memory store. 15/15 checks:

  • the field shows, starting with no cards;
  • a blank card disables Create, and filling it enables Create;
  • the create body carries both commands verbatim and in order, including a multi-line heredoc, and the api stores them;
  • the edit dialog shows the saved commands, and Save is disabled while nothing changed;
  • adding and then removing a blank card leaves nothing to save;
  • removing a command sends exactly {"setupCommands":[…],"version":1};
  • an edit to the system prompt leaves setupCommands out, and version 3 still has the list.

Full pnpm test, typecheck and prettier pass.

🤖 Generated with Claude Code

jinxi97 and others added 3 commits October 26, 2026 13:23
The create and edit dialogs get a Setup commands field: a card per
command, in run order, each a monospace textarea sized to its command
(a heredoc shows whole). A blank card holds Create and Save back, as an
empty credential field does; an edit sends the list only when it
changed, so other edits carry it forward.

The README gains a Setup commands section, with the Monid CLI as the
example: they run in the package template's build, as the sandbox's
user, each in its own shell; they see no credentials, what they fetch
is frozen at the first build, and the build's network isn't the
session's. A failing command ends the run naming it, and a network
hiccup counts too, so downloads should retry on their own. The
credentials section points file-keyed tools at it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A simpler example (git config, a work directory) in place of the Monid
CLI, and three bullets.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@jinxi97
jinxi97 merged commit bbe6434 into main Oct 26, 2026
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.

1 participant