---
title: "Project-Scoped Barebone CLI"
source: https://docs.autohand.ai/tutorials/extensions/project-scoped-barebone
---

# Build a project-scoped barebone CLI

Start from Autohand Code's explicit bare runtime, install only a repository-owned Code Health and Test Triage package set, and prove the effective capability boundary.

## Target state

``` text
sample-repository/
  .autohand/
    extensions/
      acme.code-health/
      acme.test-triage/
  src/
  tests/
```

Bare mode disables ambient hooks, LSP startup, plugin and settings sync, auto-memory, AGENTS.md auto-discovery, telemetry, notifications, community skill behavior, and slash commands. The two project packages remain discoverable as explicitly installed core runtime contributions.

## 1\. Prepare a safe repository

Use a disposable Git repository with one source directory and one focused Bun test. Keep extension source outside the repository so copied installation proves the project owns its own snapshot.

``` bash
export WORKSPACE=/work/sample-repository
export EXTENSIONS=/work/acme-code-extensions

git -C "$WORKSPACE" status --short
autohand --path "$WORKSPACE" extensions list --scope project
```

Review any existing `.autohand/extensions` content before continuing. This tutorial should not overwrite an unrelated package id.

## 2\. Validate both source packages

``` bash
autohand --path "$WORKSPACE" extensions validate "$EXTENSIONS/acme.code-health" --json
autohand --path "$WORKSPACE" extensions validate "$EXTENSIONS/acme.test-triage" --json
```

Check the ids, versions, and exact contribution arrays. Validation is read-only and should not create project extension directories or run `git grep` or `bun test`.

## 3\. Install copied project packages

``` bash
autohand --path "$WORKSPACE" extensions install "$EXTENSIONS/acme.code-health" --scope project
autohand --path "$WORKSPACE" extensions install "$EXTENSIONS/acme.test-triage" --scope project

autohand --path "$WORKSPACE" extensions list --scope project
autohand --path "$WORKSPACE" extensions doctor
```

Each package is staged, validated as a copy, and atomically moved into `$WORKSPACE/.autohand/extensions`. The source directories are no longer needed at runtime.

## 4\. Capture the expected snapshot

``` bash
autohand --path "$WORKSPACE" extensions show acme.code-health --scope project --json
autohand --path "$WORKSPACE" extensions show acme.test-triage --scope project --json
autohand --path "$WORKSPACE" extensions doctor --json
```

Expect Code Health to own `find_todos` and `code-health-reviewer`. Expect Test Triage to own `run_focused_test` and `failure-triage`. Both should be enabled, copied, and project-scoped.

## 5\. Start bare mode

``` bash
autohand --path "$WORKSPACE" --bare
```

Do not add `--unrestricted`. Bare mode reduces ambient integrations; it does not bypass permissions. Slash commands are disabled, so manage extension state from a separate terminal using the top-level commands.

## 6\. Exercise only the intended capabilities

Run two prompts:

``` text
Prompt A:
Use code-health-reviewer to inspect src/ for evidence-backed maintainability risks.
Do not edit files.

Prompt B:
Use failure-triage to reproduce tests/example.test.ts and trace the failure.
Do not edit files or weaken the test.
```

Confirm the expected shell prompts. The bare runtime still includes Autohand's built-in tools; “barebone plus extensions” means ambient optional integrations are disabled and declared packages are explicit, not that every built-in coding capability is removed.

## 7\. Prove project precedence

In an isolated test profile, install a user-scoped `acme.code-health` version with a clearly different description, then keep the project package at the same id. Inspect the package from inside the workspace.

``` bash
autohand --path "$WORKSPACE" extensions show acme.code-health --json
```

The project package should be the effective whole package. Tools and agents do not merge across scopes. Remove the isolated user fixture after the check.

## 8\. Disable one slice and rerun

Exit the bare session, then disable Test Triage:

``` bash
autohand --path "$WORKSPACE" extensions disable acme.test-triage --scope project
autohand --path "$WORKSPACE" extensions show acme.test-triage --scope project
autohand --path "$WORKSPACE" --bare
```

Code Health should remain available. Test Triage should remain inspectable but contribute neither its tool nor agent. This proves package-local removal rather than global registry reset.

## 9\. Restore or remove the composition

``` bash
autohand --path "$WORKSPACE" extensions enable acme.test-triage --scope project
autohand --path "$WORKSPACE" extensions doctor

# To return to the base project runtime:
autohand --path "$WORKSPACE" extensions remove acme.code-health --scope project --yes
autohand --path "$WORKSPACE" extensions remove acme.test-triage --scope project --yes
autohand --path "$WORKSPACE" extensions list --scope project
```

**Team rollout:** keep immutable extension sources and expected `show --json` results in release artifacts. Do not commit machine-specific linked paths or assume every developer's user scope is empty.