Skip to main content

Crate ask

Crate ask 

Source
Expand description

Core library for the ask CLI (Rust port of @pleaseai/ask).

Phase 0: this crate is a walking skeleton. The command surface is defined in cli, but the per-command logic is ported from the TypeScript implementation (packages/cli/src/) module by module in later phases (see the rust-port-20260704 track). Until a command is ported it reports a “not yet ported” notice via NotPorted.

Modules§

agents
AGENTS.md generation — maintains the <!-- BEGIN:ask-docs-auto-generated --> block and a @AGENTS.md reference in CLAUDE.md. Rust port of agents.ts.
ask_json
ask.json schema — Rust port of packages/schema/src/ask-json.ts.
cli
Command-line surface for ask, mirroring packages/cli/src/index.ts.
commands
Lazy command implementations (ask src / docs / fetch / add / …).
discovery
Convention-based discovery helpers. On this branch only candidates is wired into a command (ask add’s offline-first docs-path probe); the local adapter chain (local-ask / local-intent / local-conventions) that install consults upstream is not yet materialized here.
http
A small injectable HTTP client abstraction shared by the registry lookup, the ecosystem resolvers, and (later) the web/llms-txt sources.
ignore_files
Vendored-docs ignore-file management. Rust port of ignore-files.ts.
install
Lazy-first ask install orchestrator. Rust port of install.ts.
io
ask.json / .ask/resolved.json file I/O + hashing — Rust port of packages/cli/src/io.ts.
list
ask list model + renderer. Rust port of list/{model,aggregate,render}.ts and display/table.ts.
lockfiles
Lockfile readers — translate a dependency name into the version pinned by the project’s package manager. Rust port of packages/cli/src/lockfiles/.
markers
Marker-block helpers — Rust port of packages/cli/src/markers.ts.
registry
Registry spec parsing, ecosystem detection, and the registry HTTP lookup — Rust port of packages/cli/src/registry.ts.
resolved
.ask/resolved.json schema — Rust port of packages/schema/src/resolved.ts.
resolvers
Ecosystem resolvers — map a package name + version to a GitHub owner/repo plus a git ref, over the injectable crate::http::HttpClient. Rust port of packages/cli/src/resolvers/.
skill
Claude Code skill generation — writes a lazy-first SKILL.md per library. Rust port of packages/cli/src/skill.ts.
skills
Standalone agent-skills subsystem for ask skills — vendoring producer-side skill directories into .ask/skills/ and symlinking them into detected coding-agent directories. Separate from the docs-skill generation in skill.rs. Rust port of packages/cli/src/skills/.
sources
Source adapters — fetch docs from github / npm / llms-txt (web is deferred) and materialize them into the global store. Rust port of packages/cli/src/sources/.
spec
Spec parsing for ask.json library entries — Rust port of packages/cli/src/spec.ts.
storage
Project-local docs materialization + the ask list view. Rust port of packages/cli/src/storage.ts.
store
Global ASK store — atomic writes, entry locking, content verification, the store-version marker, and quarantine. Rust port of store/index.ts.

Structs§

NotPorted
Sentinel error for a command whose logic has not been ported to Rust yet.