npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

atcoder-cli

v2.2.0

Published

AtCoder command line tools

Downloads

421

Readme

atcoder-cli

AtCoder command line tools

  • get contest information
  • create a project directory for contests
    • auto provisioning with custom templates
  • linkage with online-judge-tools
    • submit your code without specified URL
    • auto downloading of sample inputs/outputs

解説記事(日本語)

Requirements

node.js
online-judge-tools (optional, but recommended)

Install

$ npm install -g atcoder-cli

Usage

$ acc login # login your atcoder account
$ acc session # check login status
$ # your login session will be saved to a local file, but your password won't be saved
$ # to delete the session file, use `acc logout`
$ acc new abc001 # "abc001/" directory will be created
$ cd abc001/
$ acc contest # show the contest information
$ acc tasks # show task list
$ acc add
$ cd a/
$ vim main.cpp # write your solution
$ acc submit main.cpp # to use submit function, you have to install online-judge-tools

To get detailed information, use

$ acc [COMMAND] -h

Config

$ acc config -h
$ acc config # show all global options
$ acc config <key> <value> # set option
$ cd `acc config-dir`
$ cat config.json # global config file

Provisioning Templates

With using custom templates, you can automatically prepare your template program code or build environment.

When you create new task directories, atcoder-cli can do:

  • place the scaffold program file
  • copy static files
  • exec shell command

show available templates:

$ acc templates

use the template:

$ acc new|add --template <your-template-name>

Or you can set default template:

$ acc config default-template <your-template-name>

Create a new template

$ cd `acc config-dir`
$ mkdir <your-template-name>
$ cd <your-template-name>
$ vim template.json # write your template settings

Options in template.json

{
  "task": {
    "program": ["main.cpp", ["foo.cpp", "{TaskID}.cpp"]],
    "submit": "main.cpp",
    "static": ["foo", ["bar","bar_{TaskLabel}"]],
    "testdir": "tests_{TaskID}",
    "cmd": "echo Hi!"
  },
  "contest": {
    "static": [["gitignore", ".gitignore"]],
    "cmd": "echo Ho!"
  }
}

"task" (required)

executed for each tasks.

"program" (required)
"program": (string | [string, string])[]

Your main program(s). Place main.cpp in the same directory of template.json, and write

  "program": ["main.cpp"]

then the program file will be copied to the task directory.

You can rename the file with format strings:

  "program": [["main.cpp", "{TaskId}.cpp"]] 

The file name of the program file will be "A.cpp" if the task is problem A.

To get detailed information about format strings, use acc format -h.

"submit" (required)
  "submit": string

The file name to submit. It enables to omit the filename argument to submit file, so you can run acc submit instead of acc submit <filename>.

Format strings are supported.

"static" (optional)
"static": (string | [string, string])[]

Static assets. The difference between "program" and "static" is:

  • "program" files won't be overwrited when using acc add --force.
  • "static" files will be overwrited when using acc add --force.
"testdir" (optional)
  "testdir": string

The name of the directory that sample cases will be downloaded. Without this, the directory name will be the value of acc config default-test-dirname-format.

Format strings are supported.

"cmd" (optional)
  "cmd": string

After copying files and downloading sample cases, the specified command will be executed.

The working directory is the task directory.

Parameters are given as enviromental variables:
$TEMPLATE_DIR, $TASK_DIR, $TASK_ID, $TASK_INDEX, $CONTEST_DIR and $CONTEST_ID

contest (optional)

executed only once when acc new command runs.

"static" (optional)

Same as tasks.static.

"cmd" (optional)

Same as tasks.cmd, but $TASK_* variables do not exist.