- Install/Update:
xaocis managed viaflake.nix. Ensurexaocis in your dev shell. - Auth: Add your session token:
xaoc auth add <session-token>- Get the session cookie from your browser dev tools on adventofcode.com.
- Config Dir:
~/.config/xaoc(stores tokens, inputs, puzzle text).
-
Start a Day:
xaoc prepare <day>- Fetches puzzle text and input.
- Creates
src/bin/<year>_<day>.rsfrom template (if not exists). - Example:
xaoc prepare 1
-
Run Code:
cargo run --release --bin <year>_<day>- Add
-- --p1or-- --p2to run specific parts. - Add
-- --sample <n>to run with a specific sample input extracted from the puzzle text. - Add
-- --devto run with sample inputs (extracted from puzzle text).
-
Submit:
xaoc submit <day> <part> <answer>- Example:
xaoc submit 1 1 12345 - Automatically checks against known bad answers locally before submitting.
- Updates local answer cache on success.
- Example:
The xaoc! macro customizes how your solution runs, particularly for sample inputs.
Keys:
sample_idx: (usize) 0-indexed position of sample input from puzzle description.sample_idx2: (Option) 0-indexed position for part 2's sample input.sample: (&'static str) Custom sample input string for part 1.sample2: (&'static str) Custom sample input string for part 2.no_sample: (bool) Disable all sample input processing.
Example:
xaoc!(
sample_idx = 0,
sample = "custom sample input for part 1",
sample2 = "custom sample input for part 2"
);- Sync Answers:
xaoc sync-answers- Fetches your solved answers from the website and populates local cache.
- List Tokens:
xaoc auth list
aocYYYY/: Year-specific crates.xaoc/: Shared library and CLI tool.xaoc/fixtures/template.rs: Template for new day binaries.