feat(setup): chain OneCLI install in setup:auto
The install half of the OneCLI step is fully scriptable (the gateway and CLI install themselves via `curl | sh`, PATH + api-host + .env updates are idempotent). Register the Anthropic secret is still interactive — the auto driver leaves that for `/setup` §4 to handle. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -9,11 +9,12 @@
|
|||||||
* Config via env:
|
* Config via env:
|
||||||
* NANOCLAW_TZ IANA zone override (skip autodetect)
|
* NANOCLAW_TZ IANA zone override (skip autodetect)
|
||||||
* NANOCLAW_SKIP comma-separated step names to skip
|
* NANOCLAW_SKIP comma-separated step names to skip
|
||||||
* (environment|timezone|container|mounts|service|verify)
|
* (environment|timezone|container|onecli|mounts|service|verify)
|
||||||
*
|
*
|
||||||
* Credential setup (OneCLI + channel auth + `/manage-channels`) is *not*
|
* OneCLI is installed and configured here, but secret registration (the
|
||||||
* scripted — those require interactive platform flows and are handled by
|
* Anthropic token or API key), channel auth, and `/manage-channels` stay
|
||||||
* `/setup`, `/add-<channel>`, and `/manage-channels` afterwards.
|
* interactive — they need human input. Finish those with `/setup` §4
|
||||||
|
* onwards, `/add-<channel>`, and `/manage-channels`.
|
||||||
*/
|
*/
|
||||||
import { spawn } from 'child_process';
|
import { spawn } from 'child_process';
|
||||||
|
|
||||||
@@ -114,6 +115,22 @@ async function main(): Promise<void> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!skip.has('onecli')) {
|
||||||
|
const res = await runStep('onecli');
|
||||||
|
if (!res.ok) {
|
||||||
|
if (res.fields.ERROR === 'onecli_not_on_path_after_install') {
|
||||||
|
fail(
|
||||||
|
'OneCLI installed but not on PATH.',
|
||||||
|
'Open a new shell or run `export PATH="$HOME/.local/bin:$PATH"`, then retry.',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
fail(
|
||||||
|
`OneCLI install failed (${res.fields.ERROR ?? 'unknown'})`,
|
||||||
|
'Check that curl + a writable ~/.local/bin are available; re-run `pnpm run setup:auto`.',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!skip.has('mounts')) {
|
if (!skip.has('mounts')) {
|
||||||
const res = await runStep('mounts', ['--empty']);
|
const res = await runStep('mounts', ['--empty']);
|
||||||
if (!res.ok && res.fields.STATUS !== 'skipped') {
|
if (!res.ok && res.fields.STATUS !== 'skipped') {
|
||||||
@@ -143,7 +160,7 @@ async function main(): Promise<void> {
|
|||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
console.log('\n[setup:auto] Scripted steps done. Remaining (interactive):');
|
console.log('\n[setup:auto] Scripted steps done. Remaining (interactive):');
|
||||||
if (res.fields.CREDENTIALS !== 'configured') {
|
if (res.fields.CREDENTIALS !== 'configured') {
|
||||||
console.log(' • OneCLI + Anthropic secret — see `/setup` §4 or https://onecli.sh');
|
console.log(' • Register an Anthropic secret in OneCLI — see `/setup` §4');
|
||||||
}
|
}
|
||||||
if (!res.fields.CONFIGURED_CHANNELS) {
|
if (!res.fields.CONFIGURED_CHANNELS) {
|
||||||
console.log(' • Install a channel: `/add-discord`, `/add-slack`, `/add-telegram`, …');
|
console.log(' • Install a channel: `/add-discord`, `/add-slack`, `/add-telegram`, …');
|
||||||
|
|||||||
Reference in New Issue
Block a user