Add repo aliases, tab completion, and fix sanitize#2
Merged
Conversation
Store frequently-used repos as short names in ~/.config/core-drill/config.toml (XDG on Linux, ~/Library/Application Support/ on macOS). Aliases expand transparently everywhere a repo arg is accepted (TUI, CLI output, REPL, MCP open tool). Saved storage overrides (region, anonymous, endpoint_url) merge with CLI flags, with CLI taking precedence.
Python script using icechunk + zarr to create a repo with ANSI escape codes, terminal control sequences, null bytes, RTL overrides, and other payloads in group names, array names, commit messages, branch names, and tag names.
The VTE parser inside strip_ansi_escapes treats \t and \n as control actions and removes them. Use Unicode Private Use Area sentinels to protect whitespace across the strip pass.
The TUI path had its own inline repo-opening code that bypassed open_repo(), which meant alias resolution (and any future open logic) didn't apply. Now all modes use the single open_repo() entry point.
Aliases now store all CLI flags including arraylake_api, so dev Arraylake repos can be aliased with their custom endpoint.
--arraylake-api now accepts "dev" (dev.api.earthmover.io) and "prod" (api.earthmover.io) as shorthands. Full README section covers alias add/list/rm with examples.
- clap_complete with unstable-dynamic for runtime completions - CompleteEnv handles COMPLETE=<shell> env var automatically - install-completions subcommand appends setup to shell config - Alias names complete dynamically from config file - dev/prod shorthands for --arraylake-api - README docs for aliases, completions, arraylake-api shorthands
- config::load(): replace exists() + read_to_string() with single
read_to_string() matching on NotFound (eliminates TOCTOU race)
- sanitize(): use &str constants for PUA sentinels instead of
char::to_string() per call (eliminates 2 temp allocations)
- install_completions(): use dirs::home_dir() instead of
std::env::var("HOME") for consistency with config.rs
- Remove unused PathBuf import
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
core-drill alias add/list/rm— save frequently-used repos as short names. Stored in config TOML. Aliases expand transparently in TUI, CLI, REPL, and MCPopentool. All CLI flags (region, anonymous, endpoint_url, arraylake_api) saved with the alias.core-drill install-completionsappends setup to your shell config. Completions include subcommands, flags, and alias names (dynamically loaded from config). Powered byclap_completewithCompleteEnv.--arraylake-apishorthands: acceptsdev(dev.api.earthmover.io) orprod(api.earthmover.io) in addition to full URLs.strip-ansi-escapesv0.2's VTE parser eats\tand\n. Uses Unicode PUA sentinels to protect whitespace. Fixes failing nix build.open_repo()entry point (was duplicated inline).scripts/create_adversarial_repo.pygenerates a repo with ANSI codes, OSC sequences, null bytes, RTL overrides, 500-char names in group/array/branch/tag names and commit messages.dirscrate consistently.Usage
Test plan
cargo test— all 27 tests pass (including previously-failingpreserves_newlines_and_tabs)cargo build— clean, zero warnings🤖 Generated with Claude Code