Practical overview
When it fits
Use Solidity CLI when a JavaScript or TypeScript workflow needs command-line or programmatic Solidity compilation, especially for folder builds or compilation as part of a package script.
Who it is for
- Developers compiling Solidity contracts as part of JavaScript project builds
- TypeScript developers who want generated JavaScript and TypeScript compilation output
- Teams managing Solidity projects with multiple contracts or compiler versions
Documented uses
- Compile Solidity files from a source folder into a destination folder.
- Compile Solidity source text or an individual contract file from JavaScript code.
- Add contract compilation as a package-script step before tests.
- Reduce repeated compilation through caching and handle compiler versions indicated by contract pragmas.
Requirements & limits
- The README documents both CLI and programmatic use, including source strings, individual files and folders.
- The tool caches output and recompiles when contract code changes.
- Compiler versions are discovered from pragma declarations and installed when needed.
- The repository specifies the Apache-2.0 license.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Compile a folder of Solidity files from the command line
Compile Solidity files matching a source pattern into a destination folder using the CLI.
Before you start
- Node.js package installation using npm
- Solidity source files in a folder
Steps
Install the CLI globally with npm install -g solidity-cli.
Run solidity with an input pattern and output folder, such as solidity -i './test/contracts/*.sol' -o ./test/compiled/.
Expected outcome
The CLI compiles the matched Solidity files into the specified destination.
Guide limitations
- The documented command covers compilation; it does not describe deployment or contract execution.
Add Solidity compilation before a package test script
Configure a JavaScript project package script to compile Solidity files before tests.
Before you start
- A JavaScript project with a package.json file
- Solidity contract files in a project folder
Steps
Install solidity-cli as a development dependency with npm install solidity-cli --save-dev.
Add a pretest script that invokes solidity-cli with the contracts input pattern and compiled output folder.
Expected outcome
The package configuration runs Solidity compilation as a pre-test step.
Guide limitations
- The README shows the package-script configuration but does not provide test commands or deployment steps.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 16 October 2026
- Original website title
- pubkey/solidity-cli · Official homepage title · retained in its source language

