Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ jobs:
- name: Run tests
run: cargo test --workspace

- name: Run CLI semantic diff harness
if: matrix.os == 'ubuntu-latest'
shell: bash
run: ATOMIC_BIN="$PWD/target/debug/atomic" bash tests/harness/run_all.sh 09

fmt:
name: Format
runs-on: ubuntu-latest
Expand Down
9 changes: 8 additions & 1 deletion atomic-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,13 @@ Global identity configuration is stored in `~/.config/atomic/` (or platform equi
# Run all CLI tests
cargo test -p atomic-cli

# Validate that every public command path renders help
cargo test -p atomic-cli --test cli_surface_integration_test

# Run the black-box CLI harness against a freshly built binary
cargo build -p atomic-cli
ATOMIC_BIN="$PWD/target/debug/atomic" bash tests/harness/run_all.sh

# Run tests serially (required for integration tests that change cwd)
cargo test -p atomic-cli -- --test-threads=1

Expand All @@ -883,4 +890,4 @@ cargo test -p atomic-cli -- --nocapture

## License

Dual-licensed under MIT and Apache 2.0.
Dual-licensed under MIT and Apache 2.0.
22 changes: 21 additions & 1 deletion atomic-cli/src/commands/agent/disable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,12 @@ impl Disable {
/// - `claude-code` → `~/.claude/settings.json`
/// - `gemini-cli` → `~/.gemini/settings.json`
/// - `agy` → `~/.gemini/config/plugins/atomic/` (plugin)
/// - `codex` → `~/.codex/hooks.json`
/// - No `--agent` flag → removes from all agents that have global hooks
fn run_global(&self) -> CliResult<()> {
use atomic_agent::hooks::agy::AgyHook;
use atomic_agent::hooks::claude_code::ClaudeCodeHook;
use atomic_agent::hooks::codex::CodexHook;
use atomic_agent::hooks::gemini_cli::GeminiCliHook;

let agents: Vec<&str> = if let Some(ref name) = self.agent {
Expand All @@ -230,6 +232,9 @@ impl Disable {
if AgyHook::new().is_installed_global() {
found.push("agy");
}
if CodexHook::new().is_installed_global() {
found.push("codex");
}
found
};

Expand Down Expand Up @@ -295,6 +300,21 @@ impl Disable {
}
}
}
"codex" => {
let hook = CodexHook::new();
if !hook.is_installed_global() {
continue;
}
match hook.uninstall_global() {
Ok(()) => {
print_success("Removed global hooks from ~/.codex/hooks.json");
total_removed += 1;
}
Err(e) => {
print_error(&format!("Failed to remove Codex global hooks: {}", e));
}
}
}
"kiro" => {
print_success("Kiro hooks are configured through the IDE panel.");
println!(
Expand All @@ -309,7 +329,7 @@ impl Disable {
}
other => {
print_warning(&format!(
"Global disable is not supported for '{}'. Supported agents: claude-code, gemini-cli, agy, kilo, kiro",
"Global disable is not supported for '{}'. Supported agents: claude-code, gemini-cli, agy, codex, kilo, kiro",
other
));
}
Expand Down
16 changes: 11 additions & 5 deletions atomic-cli/src/commands/agent/enable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,18 @@ impl Command for Enable {
// Install for all detected agents
let detected = registry.detect(&repo_root);
if detected.is_empty() {
// If none detected, try all registered agents
print_warning("No agents detected — installing hooks for all registered agents.");
registry.list()
} else {
detected
// Do not install hooks when no agent is detected.
print_error(
"No agents detected in this repository — nothing to enable with --all.",
);
print_warning(
"Create a .claude/, .gemini/, or .agents/ directory first, or use --agent <name>.",
);
return Err(crate::error::CliError::InvalidArgument {
message: "no agents detected for --all".to_string(),
});
}
detected
} else if let Some(ref name) = self.agent {
// Specific agent requested — validate it exists
registry
Expand Down
40 changes: 29 additions & 11 deletions atomic-cli/src/commands/clone/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -529,14 +529,14 @@ impl Clone {
}

// Apply downloaded changes to the local view
let mut apply_errors = Vec::new();
if stats.changes_downloaded > 0 {
print_blank();
progress.phase = ClonePhase::Applying;
let spinner = create_spinner("Inserting changes into view...");

// Insert each downloaded change in order to build the graph
let insert_options = atomic_repository::InsertOptions::default();
let mut apply_errors = Vec::new();

for entry in &remote_entries {
let hash = match atomic_core::types::Hash::from_base32(entry.hash.as_bytes()) {
Expand Down Expand Up @@ -657,21 +657,39 @@ impl Clone {

progress.phase = ClonePhase::Complete;

// Final summary
// Keep partial output, but return failure when any step failed.
print_blank();
if stats.has_failures() {
if stats.has_failures() || !apply_errors.is_empty() {
print_warning(&format!(
"Clone completed with errors: {} downloaded, {} failed",
stats.changes_downloaded, stats.changes_failed
));
} else {
print_success(&format!(
"Clone complete: {} downloaded into {}/",
format_count(stats.changes_downloaded, "change"),
target_path.display()
"Clone completed with errors: {} downloaded, {} failed to download, {} failed to apply",
stats.changes_downloaded,
stats.changes_failed,
apply_errors.len(),
));

if self.into_existing {
print_hint(
"Next: run 'atomic git import --incremental' to import the Git checkout.",
);
}

// Preserve the partial clone before returning the error.
if let Some(guard) = guard {
guard.disable();
}
return Err(CliError::Internal(anyhow::anyhow!(
"clone completed with errors ({} download, {} apply)",
stats.changes_failed,
apply_errors.len(),
)));
}

print_success(&format!(
"Clone complete: {} downloaded into {}/",
format_count(stats.changes_downloaded, "change"),
target_path.display()
));

if self.into_existing {
print_hint("Next: run 'atomic git import --incremental' to import the Git checkout.");
}
Expand Down
7 changes: 3 additions & 4 deletions atomic-cli/src/commands/git/push.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,9 @@ impl Command for Push {
print_success(&format!("Pushed to {}/{}", self.remote, current_view));
}
Err(e) => {
print_warning(&format!(
"Commit created but push failed: {}. Run 'git push' manually.",
e
));
// Keep the local commit, but report the failed push.
print_warning("Commit created locally. Run 'git push' manually to retry.");
return Err(e);
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions atomic-cli/src/commands/intent/delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ impl Command for IntentDelete {
let repo = Repository::open(&root).map_err(CliError::Repository)?;

if !self.force {
// Check that the intent exists before prompting.
repo.vault_intent_show(&self.id)
.map_err(CliError::Repository)?;

let prompt = format!(
"Discard intent '{}'? This removes the unstarted draft from the vault.",
self.id
Expand Down
14 changes: 11 additions & 3 deletions atomic-cli/src/commands/org/delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,18 @@ impl Command for OrgDelete {

impl OrgDelete {
async fn execute(&self) -> CliResult<()> {
// Prompt for confirmation unless --force is set.
let client = build_client(self.org.as_deref(), None).await?;

// `--force` skips both the precheck and confirmation.
if !self.force {
// Check that the organization exists before prompting.
atomic_teams::org::get_org(&client, &self.slug)
.await
.map_err(|e| CliError::RemoteError {
message: e.to_string(),
url: None,
})?;

print_warning(&format!(
"This will permanently delete organization '{}' and all its data.",
self.slug
Expand All @@ -103,8 +113,6 @@ impl OrgDelete {
}
}

let client = build_client(self.org.as_deref(), None).await?;

atomic_teams::org::delete_org(&client, &self.slug)
.await
.map_err(|e| CliError::RemoteError {
Expand Down
Loading
Loading