Skip to content

Repository files navigation

aoc-cli-node

license CI Release standard-readme compliant

An Advent of Code command-line tool developed using Node.js.

Table of Contents

Install

Both packages require Node.js 20 or newer when used with Node.js.

For the command-line tool:

# ✨ Auto-detect
npx nypm install -g @bryan-hoang/aoc-cli

# npm
npm install -g @bryan-hoang/aoc-cli

# yarn
yarn add -g @bryan-hoang/aoc-cli

# pnpm
pnpm install -g @bryan-hoang/aoc-cli

# bun
bun install -g @bryan-hoang/aoc-cli

# deno
deno install -g @bryan-hoang/aoc-cli

# Running the tool
aoc <args>
# or
aoc-cli <args>

or

# npm
npx @bryan-hoang/aoc-cli@latest <args>

# pnpm
pnpm dlx @bryan-hoang/aoc-cli@latest <args>

# bun
bunx @bryan-hoang/aoc-cli@latest <args>

# deno
deno run -A npm:@bryan-hoang/aoc-cli@latest <args>

For the client library:

# ✨ Auto-detect
npx nypm install @bryan-hoang/aoc-client

# npm
npm install @bryan-hoang/aoc-client

# yarn
yarn add @bryan-hoang/aoc-client

# pnpm
pnpm add @bryan-hoang/aoc-client

# bun
bun install @bryan-hoang/aoc-client

# deno
deno install npm:@bryan-hoang/aoc-client

Usage

For the command-line tool:

$ aoc help
An Advent of Code command-line tool

USAGE aoc [OPTIONS] submit|download|help

COMMANDS

  submit    Submit puzzle answer
  download  Save puzzle description and input to files
  help      Print this message or the help of the given subcommand(s)

OPTIONS

  -d, --day <DAY>            Puzzle day [default: last unlocked day (during Advent of Code month)]
  -y, --year <YEAR>          Puzzle year [default: year of current or last Advent of Code event]
  -s, --session-file <PATH>  Path to session cookie file [default: /home/bryan/.config/advent-of-code/session-cookie.txt]
  -h, --help                 Print help information
  --version                  Print version information

For the client library:

ESM (Node.js, Bun, Deno)

import { AocClientBuilder, AocClient } from "@bryan-hoang/aoc-client";

CommonJS (Legacy Node.js)

const { AocClientBuilder, AocClient } = require("@bryan-hoang/aoc-client");

CDN (Deno and Browsers)

import { AocClientBuilder, AocClient } from "https://esm.sh/@bryan-hoang/aoc-client";

Maintainers

@bryan-hoang

Contributing

PRs accepted.

Small note: if editing the README, please conform to the standard-readme specification.

License

MIT © 2024 Bryan Hoang

Functionality is inspired by scarvalhojr/aoc-cli. Project structure is inspired by nuxt/cli.


🤖 auto updated with automd

About

An Advent of Code command-line tool developed using Node.js.

Topics

Resources

Code of conduct

Stars

1 star

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages