aoc-toolkit 0.1.0-alpha.2

A toolkit for solving Advent of Code problems
Documentation
# AOC Toolkit

[![CI](https://github.com/KyrboForge/aoc-toolkit/actions/workflows/ci.yml/badge.svg)](https://github.com/KyrboForge/aoc-toolkit/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

A developer toolkit for [Advent of Code](https://adventofcode.com/), built in Rust and designed to support multiple solution languages through a unified CLI.

**Early alpha:** Rust is the only implemented adapter. The current version provides project discovery, execution of registered Rust solutions and a local input cache. Project initialization, day scaffolding, interactive authentication, progress tracking, benchmarking and a TUI are planned, not available commands yet.

## Installation

Once v0.1.0-alpha.1 is published, install it with Cargo:

```sh
cargo install aoc-toolkit --version 0.1.0-alpha.1 --locked
```

Alternatively, obtain a prebuilt executable from [GitHub Releases](https://github.com/KyrboForge/aoc-toolkit/releases). The release pipeline targets Linux and macOS (x86_64 and ARM64), and Windows (x86_64). Running Rust solutions requires a compatible Rust toolchain and Cargo even when the global CLI is installed from a prebuilt binary.

```sh
aoc --help
aoc --version
```

## Getting started

After installing AOC Toolkit, run:

```sh
aoc setup
```

To authenticate without automatically opening your browser:

```sh
aoc setup --manual
```

For manual authentication instructions, run:

```sh
aoc auth login --help
```

Your Advent of Code session is stored in the system
credential store.

Check or remove your stored session:

```sh
aoc auth status
aoc auth logout
```

Browser extension integration is currently experimental
and is not required to use AOC Toolkit.

## Using an existing Rust project

The global CLI searches the current directory and its ancestors for an `aoc.toml` file. Configure a Rust project that exposes a local runner binary.

Example for a single-package project:

```toml
schema_version = 1

[project]
language = "rust"
solutions = "src"

[runner]
manifest = "Cargo.toml"
profile = "release"
```

Set `runner.binary` if Cargo needs an explicit binary target. Paths are relative to the project root. For a workspace, point `runner.manifest` to the solution package's manifest.

In the solution package, use the same toolkit version with the runner feature:

```toml
[dependencies.aoc-toolkit]
version = "=0.1.0-alpha.1"
default-features = false
features = ["runner"]
```

Implement the `aoc_toolkit::core::Day` trait for each solver, register your solvers in a static `Registry`, and pass that registry to `aoc_toolkit::runner::run` from your local binary. The global CLI delegates execution to that binary through Cargo. The project generator will simplify this setup in a future release.

### Run solutions

```sh
aoc run                         # Latest registered solution
aoc run --year 2023             # Latest registered day in 2023
aoc run --year 2023 --day 1      # Both parts of a specific day
aoc run --year 2023 --day 1 --part 2
aoc run --year 2023 --all        # All registered days in a year
aoc run --all                   # All registered solutions
```

### Puzzle inputs

The local runner reads cached input from `inputs/<year>/<day>.txt` relative to the project root when invoked through the global CLI. If the cache is missing, the current client attempts to fetch input using the user's own `SESSION_ID` environment variable.

Automatic login and secure credential storage are not implemented yet. Keep inputs and credentials private, exclude them from version control, and respect Advent of Code's service rules. Prefer existing cached input to repeated requests.

## Cargo features

| Feature | Purpose |
| --- | --- |
| No default features | Minimal Rust solver contracts and registry |
| `client` | HTTP and input caching infrastructure |
| `runner` | Local Rust solution runner (includes client) |
| `cli` (default) | Global aoc executable, project configuration and adapters |

## Development roadmap

- [x] Rust solver contracts and registry
- [x] Local Rust runner and global CLI delegation
- [x] Cross-platform build and test matrix
- [ ] Project initialization and day scaffolding
- [ ] Secure desktop authentication and improved input caching
- [ ] Progress tracking and benchmarking
- [ ] Interactive terminal UI
- [ ] Additional language adapters

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md), [architecture](docs/architecture.md) and [language support](docs/language-support.md). Release history is available in [GitHub Releases](https://github.com/KyrboForge/aoc-toolkit/releases).

This is an independent community project, not affiliated with Advent of Code.

## License

[MIT](LICENSE).