# Getting started
WARNING
This guide is temporary. Before @aocjs/cli (opens new window) v1 is released, an automatic method will be availible making easier first steps.
# Instalation
To get started you need to install @aocjs/cli.
npm i @aocjs/cli
# Configuration
Before start running your code, you need to specify your session cookie by creating a config file named .aocrc
. After that, copy your cookie from adventofcode.com. If you don't know how, follow this steps.
{
"$schema": "https://raw.githubusercontent.com/aocjs/cli/main/schema/schema.json",
"session": "YOUR PRIVATE KEY"
}
# TypeScript
If you want to use TypeScript to solve your problems, you must specify it in your config file by setting a compiler.
{
"$schema": "https://raw.githubusercontent.com/aocjs/cli/main/schema/schema.json",
"session": "YOUR PRIVATE KEY",
"compiler": "ts"
}
You will need ts-node too.
npm i ts-node
# 🚀 Start up
Now you can start your first day by running the following command. This will create and run day1.js
or day1.ts
, including required file structure.
npx aoc start day1
You can simplify your run command, by adding the next script to your package.json
.
"scripts": {
"start": "npx aoc start"
},
If you do so, you could run day1 as follows.
npm start day1
← Introduction Data →