{"id":14035888,"url":"https://github.com/datawrapper/cli","last_synced_at":"2025-07-27T03:30:59.076Z","repository":{"id":55382193,"uuid":"165234212","full_name":"datawrapper/cli","owner":"datawrapper","description":"Command Line Utility to make project scaffolding and tooling setup simple.","archived":true,"fork":false,"pushed_at":"2021-01-04T12:00:11.000Z","size":865,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-08-13T03:04:16.772Z","etag":null,"topics":["cli","scaffolding"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datawrapper.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-11T11:37:59.000Z","updated_at":"2023-01-28T11:01:24.000Z","dependencies_parsed_at":"2022-08-14T23:01:00.348Z","dependency_job_id":null,"html_url":"https://github.com/datawrapper/cli","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datawrapper%2Fcli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datawrapper%2Fcli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datawrapper%2Fcli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datawrapper%2Fcli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datawrapper","download_url":"https://codeload.github.com/datawrapper/cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227753792,"owners_count":17814728,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","scaffolding"],"created_at":"2024-08-12T03:01:45.310Z","updated_at":"2024-12-02T15:31:06.763Z","avatar_url":"https://github.com/datawrapper.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# @datawrapper/cli [![CircleCI](https://circleci.com/gh/datawrapper/cli.svg?style=svg\u0026circle-token=87e50e1f79908137e5b8dfe612cb779650cea400)](https://circleci.com/gh/datawrapper/cli)\n\n\u003e **Note:** This is an internal tool used by the Datawrapper development team. It is _not_ a command-line interface for the Datawrapper API, so you can't use it to create/edit charts etc.\n\u003e\n\u003e **⚠️ This is an internal tool used by the Datawrapper development team️️️️️! ⚠️**\n\nCommand Line Utility to make project scaffolding and tooling setup simple.\n\nThis tool is mainly in use at Datawrapper internally and has Datawrapper specific settings and configuration. If this is helpful for you great but it might not. PRs welcome but we might not merge everything.\n\n## Installation\n\n### Install globally (recommended)\n\n```sh\n# global installation\n$ npm i -g @datawrapper/cli\n```\n\n### Install as project dependency or use `npx`\n\n```sh\n$ npm i -D @datawrapper/cli\n\n# usage with `npx`\n$ npx @datawrapper/cli lint\n```\n\n## Usage\n\nThe `--help` command shows you more information about everything you can do with `dw`.\n\nIt is possible to run `--help` for all sub commands.\n\n```\n❯ dw --help\nUsage: dw [options] [command]\n\nOptions:\n  -V, --version     output the version number\n  -h, --help        output usage information\n\nCommands:\n  lint [pattern]    Use eslint to lint your code\n\n  This command will by default only lint files in the `src` directory.\n  It's possible to pass a custom glob pattern:\n\n  \u003e dw lint index.js\n\n  This will only lint `index.js`.\n\n  format [pattern]  Use prettier to format your code\n\n  This command will by default only lint files in the `src` directory.\n\n  setup             Project setup commands\n  update [options]  Update `dw` cli\n```\n\nThe following commands are available.\n\n```sh\n# Quick setup scripts for use in existing or new projects\n❯ dw setup\n\nWhat do you want to setup?\n\n# configures eslint with the Datawrapper eslint config\n❯  ☐  Code linting\n\n# configures prettier to format code\n   ☐  Code formatting\n\n# configures commit hooks that run linting and/or formatting scripts before commits\n   ☐  Git Hooks\n\n# copies a standard CircleCI config into the repository\n   ☐  CircleCI\n\n# Adds a standard gitignore file for node based projects\n   ☐  Add gitignore\n\n# Installs recommended Visual Studio Code Extensions for a better workflow in Datawrapper projects.\n   ☐  VSCode Extensions\n\nPress [space] to select an option and [enter] to start the setup.\n```\n\nOther commands to update or quickly lint/format a file:\n\n```sh\n# lints your projects source files based on Datawrapper Code Guidelines\n# Wrapper around `eslint src --fix`\n❯ dw lint\n\n# formats your projects source files based on Datawrapper Code Guidelines\n# Wrapper around `prettier src/**/*.js --write`\n❯ dw format\n\n# Updates the `dw` CLI to the latest version\n# Wrapper around `npm i -g @datawrapper/cli`\n❯ dw update\n```\n\n## Important!\n\n**The setup command will overwrite existing files, and keys in your package.json. DO Not run it if you want to keep your current config!**\n\nIf by accident, you overwrite your config files it should be pretty easy to revert when using git.  \n(In a future update this behaviour might change and `dw` won't just blindly overwrite files.)\n\n## Development\n\nTo contribute features to `@datawrapper/cli`, clone the repository and install dependencies with `npm`.\n\n```sh\n❯ git clone git@github.com:datawrapper/cli.git\n❯ npm install\n```\n\nWith these commands the development environment is setup. Run `npm start` to build the executable with Parcel, which will end up in `bin/index.js`. Try to run it with `node bin/index.js --help`. The terminal should print the help instructions. To get a global `dw` command, link the project with `npm link`.\n\nThe recommended setup is to run `npm start` in a terminal window. This will start Parcel and watches all source files for changes and rebuilds the executable.\n\n```sh\n~/code/dw-cli\n❯ npm start\n\n\u003e @datawrapper/cli@0.1.1 start /Users/fabian/code/dw-cli\n\u003e parcel src/index.js --target node --out-dir bin/\n\n✨  Built in 26ms.\n```\n\nIn another terminal window try out the CLI by linking once and running `dw --help`.\n\n```sh\n~/code/dw-cli\n❯ npm link\n❯ dw --help\n```\n\n## Features\n\n-   [x] `--help` - List available commands and how to use them\n-   [x] `--version` - Prints the version of this tool\n-   [x] `lint` - Use eslint to lint your code base or a file\n-   [x] `format` - Use prettier to format your code base or a file\n-   [x] `update` - Updates the cli tool\n-   [x] `setup` - Setup tools\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatawrapper%2Fcli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatawrapper%2Fcli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatawrapper%2Fcli/lists"}