-
Notifications
You must be signed in to change notification settings - Fork 1
docs(project): Add comprehensive project documentation and enhance IDE schema integration #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -139,3 +139,6 @@ dist | |
| vite.config.js.timestamp-* | ||
| vite.config.ts.timestamp-* | ||
| .vite/ | ||
|
|
||
| # Gemini | ||
| .gemini/ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| # Gemini Project: cli-schema | ||
|
|
||
| ## Project Overview | ||
|
|
||
| This project provides a canonical JSON schema for defining Command-Line Interfaces (CLIs) in a declarative YAML format. The goal is to establish a universal standard for CLIs, enabling automation, consistency, and a better developer experience. The core of the project is a JSON schema that defines the structure of the CLI, and a validation library to check YAML files against this schema. | ||
|
|
||
| The main technologies used are: | ||
|
|
||
| - **Node.js:** The runtime environment for the project. | ||
| - **JSON Schema:** Used to define the structure of the CLI definition files. | ||
| - **YAML:** The format for writing the declarative CLI definitions. | ||
| - **Ajv:** A fast JSON schema validator. | ||
| - **Jest:** The testing framework. | ||
| - **Commander.js:** A library for building command-line interfaces in Node.js. | ||
| - **ESLint and Prettier:** For code linting and formatting. | ||
|
|
||
| ## Building and Running | ||
|
|
||
| ### Installation | ||
|
|
||
| To install the project dependencies, run: | ||
|
|
||
| ```bash | ||
| npm install | ||
| ``` | ||
|
|
||
| ### Running the CLI | ||
|
|
||
| The main CLI tool can be run with the following command: | ||
|
|
||
| ```bash | ||
| npm start | ||
| ``` | ||
|
|
||
| You can also use the `npx` command to run the CLI and validate a file: | ||
|
|
||
| ```bash | ||
| npx cli-schema path/to/your/file.yml | ||
| ``` | ||
|
|
||
| ### Running Tests | ||
|
|
||
| To run the test suite, use the following command: | ||
|
|
||
| ```bash | ||
| npm test | ||
| ``` | ||
|
|
||
| ### Linting | ||
|
|
||
| To check the code for linting errors, run: | ||
|
|
||
| ```bash | ||
| npm run lint | ||
| ``` | ||
|
|
||
| To automatically fix linting errors, run: | ||
|
|
||
| ```bash | ||
| npm run lint:fix | ||
| ``` | ||
|
|
||
| ### Formatting | ||
|
|
||
| To format the code using Prettier, run: | ||
|
|
||
| ```bash | ||
| npm run format | ||
| ``` | ||
|
|
||
| ## Development Conventions | ||
|
|
||
| - **Code Style:** The project uses Prettier for automatic code formatting and ESLint for enforcing code style and quality. | ||
| - **Testing:** Tests are written using the Jest framework and are located in the `test` directory. | ||
| - **Contributions:** Contributions are welcome. Please refer to the `CONTRIBUTING.md` file for guidelines. | ||
| - **Project Structure:** The project follows a standard Node.js project structure: | ||
| - `bin`: Contains the executable script for the CLI. | ||
| - `src`: Contains the main source code for the validation library. | ||
| - `schema`: Contains the JSON schema for the CLI definitions. | ||
| - `test`: Contains the tests for the project. | ||
| - `examples`: Contains example YAML definition files. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| { | ||
| "$id": "https://example.com/cli.schema.json", | ||
| "$id": "https://cdn.jsdelivr.net/npm/cli-schema@3.0.0/schema/cli.schema.json", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hardcoding the version A more robust approach would be to automate the version update in this URI as part of your release process. This ensures the schema's |
||
| "$schema": "http://json-schema.org/draft-07/schema#", | ||
| "title": "CLI Schema", | ||
| "description": "Canonical schema for declarative CLI definitions", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation refers to a
CONTRIBUTING.mdfile for contribution guidelines. However, this file doesn't appear to be present in the repository, which could be confusing for potential contributors. Please consider adding theCONTRIBUTING.mdfile or updating this line to point to the correct contribution process.