← Catalog

RFC-012AcceptedToolchain

CLI

Depends: RFC-005RFC-008RFC-011RFC-013

Blocks:

1. Abstract

This RFC defines the unified aura CLI (implemented in Rust): the single entrypoint for create, build, run, test, check, format, package, and toolchain management. Subcommands delegate to compiler, package manager, build, and test subsystems while presenting a consistent UX, exit codes, and machine-readable output modes.

Toolchain today (2026-07-21, C12r): shipped subcommands — new, init, version, check, build, run, test, emit-c on files or package dirs (aura.toml). aura run / aura test forward args after -- to the process (C12c); programs read argv via std.io.args(). Pretty diagnostics with line:col snippets. Not yet: fmt, registry/add/publish, JSON machine output, release profiles beyond basic link.

2. Motivation

2.1 Problem statement

Fragmented tools (fmt, build, pkg as separate binaries with divergent flags) harm onboarding. One CLI is part of the language product (RFC-000 P5).

2.2 Why now

All toolchain RFCs need a user-facing contract.

2.3 Success metrics

MetricTarget
Discoverabilityaura --help covers daily verbs
ScriptabilityStable exit codes + JSON modes
Speedaura check optimized path (no full link)

3. Goals

  • One binary: aura.
  • Daily workflow verbs with Cargo/Go-like familiarity.
  • Consistent global flags (--verbose, --color, --dir).
  • Extensibility via subcommands; avoid plugin free-for-all in MVP.

4. Non-goals

  • Interactive TUI IDE replacement.
  • Cross-language task runner (Make/npm scripts platform).
  • Guaranteed stable output formatting of human text (JSON is stable).

5. Prior art & alternatives

CLINotesTake
cargoSubcommand UXPrimary
goSimple verbsInspiration
npmScripts cultureContrast
gitUbiquityHelp style

6. Design

6.1 Command map

CommandPurpose
aura new <name>Scaffold project
aura initManifest in existing dir
aura buildCompile & link
aura run [path] [-- args…]Build (if needed) + execute bin; args after -- go to the process
aura checkTypecheck/parse without full link
aura test [path] [-- args…]Build & run tests; same -- pass-through as run
aura fmtFormat sources
aura fixApply machine-applicable fixes (later)
aura docGenerate docs (later)
aura add / removeDependencies
aura updateUpdate lock within constraints
aura treeDep graph
aura publishPublish package
aura cleanRemove target/
aura version / aura toolchainVersion & install (RFC-013)

6.2 Global flags

code
--help, -h
--version, -V
--verbose, -v
--quiet, -q
--color auto|always|never
--directory, -C <path>
--offline

6.3 Output & exit codes

CodeMeaning
0Success
1General / test failure / compile error
2CLI usage error
>2Reserved (signals-related)

--format json on check/test where supported for tooling.

6.4 Configuration

  • Project: aura.toml
  • User: ~/.aura/config.toml (proxy, registry, defaults)
  • Env: AURA_* overrides documented

6.5 Formatting (aura fmt)

  • Deterministic formatter; CI --check mode.
  • Config subset in aura.toml [fmt] (line width, etc.).

6.6 UX principles

  • Prefer sensible defaults over required flags.
  • Errors: compiler diagnostics passthrough with summary.
  • Never delete src/ on clean.

6.7 Examples

code
aura new hello && cd hello
aura run
aura run . -- flag value
aura test
aura build --release -o hello
aura check --format json

6.8 Error model / edge cases

CaseBehavior
Not a project dirError suggesting init
Multiple bins runRequire --bin
Ctrl-CNon-zero; cancel build workers

6.9 Compatibility & migration

  • Subcommand names stable post-0.1.
  • Hidden aliases allowed; deprecated flags warn.

7. Open questions

#QuestionOptionsOwnerStatus
1aura pkg namespace vs flat addflat (aura add)CLIResolved
2Plugin subcommandslaterCLIDeferred — post-MVP
3Shell completion packagingCLIResolvedaura completions <shell> generates scripts (not separate pkgs)

8. Rationale & trade-offs

Cargo-like flat verbs optimize for daily memory. Single binary matches product story. JSON for machines, human text for humans. Cost: large CLI surface—mitigated by good help and docs.

9. Unresolved / future work

  • aura fix, aura doc, aura bench
  • Interactive aura add search
  • Watch mode aura run --watch

10. Security & safety considerations

  • publish requires explicit auth.
  • Commands that execute project code (run, test) are trusted-project operations.
  • Config file permissions documented on multi-user systems.

11. Implementation plan (optional)

PhaseScopeExit criteria
L0new/build/run/checkHello path
L1test/fmtCI usable
L2add/update/publishPackage path

12. References


Changelog

DateAuthorChange
2026-07-16Defer plugin cmds; lock aura completions <shell>
2026-07-16Status → Accepted — Review: command map matches shipped check/build/run/test
2026-07-16Note shipped check/build/run/test/emit-c
2026-07-15Initial skeleton
2026-07-15Solid draft: command map, exit codes
2026-07-15Lock flat package commands