Skip to content

Commit 2516015

Browse files
committed
docs: update usage via npx
1 parent 45c3cb4 commit 2516015

File tree

1 file changed

+64
-24
lines changed

1 file changed

+64
-24
lines changed

README.md

Lines changed: 64 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,69 @@
88

99
Welcome to the [Codebase Context Specification (CCS)](./CODEBASE-CONTEXT.md) repository! This project establishes a standardized method for embedding rich contextual information within codebases to enhance understanding for both AI and human developers. By providing a clear and consistent way to communicate project structure, conventions, and key concepts, we significantly improve code comprehension and facilitate more effective collaboration between humans and AI in software development.
1010

11+
## Quick Links
12+
13+
- [Full Specification (CODEBASE-CONTEXT.md)](./CODEBASE-CONTEXT.md)
14+
- [GitHub Repository](https://github.com/Agentic-Insights/codebase-context-spec)
15+
- [NPM Package (codebase-context-lint)](https://www.npmjs.com/package/codebase-context-lint)
16+
- [SubStack Article by Vaskin](https://agenticinsights.substack.com/p/codebase-context-specification-rfc)
17+
- [Context File Example (.context.md)](.context.md)
18+
- [AI Assistant Prompt (CODING-ASSISTANT-PROMPT.md)](CODING-ASSISTANT-PROMPT.md)
19+
20+
## Installation
21+
22+
To install the Codebase Context Linter globally, use npm:
23+
24+
```bash
25+
npm install -g codebase-context-lint
26+
```
27+
28+
## CLI Usage
29+
30+
After global installation, you can use the `codebase-context-lint` command to lint your project:
31+
32+
```bash
33+
codebase-context-lint [directory_to_lint] [options]
34+
```
35+
36+
You can also use npx to run the linter without installing it globally:
37+
38+
```bash
39+
npx codebase-context-lint [directory_to_lint] [options]
40+
```
41+
42+
If no directory is specified, the linter will default to the current directory.
43+
44+
Options:
45+
- `--log-level <level>`: Set the logging level (error, warn, info, debug). Default: info
46+
- `--help`, `-h`: Show the help message
47+
48+
Examples:
49+
```bash
50+
codebase-context-lint
51+
codebase-context-lint .
52+
codebase-context-lint /path/to/project --log-level debug
53+
npx codebase-context-lint
54+
npx codebase-context-lint /path/to/project --log-level debug
55+
```
56+
57+
The linter will validate your .context.md, .context.yaml, .context.json, .contextdocs.md, and .contextignore files according to the Codebase Context Specification.
58+
59+
## Library Usage
60+
61+
You can also use the Codebase Context Linter as a library in your TypeScript or JavaScript projects:
62+
63+
```typescript
64+
import { ContextLinter, LogLevel } from 'codebase-context-lint';
65+
66+
const linter = new ContextLinter(LogLevel.INFO);
67+
const isValid = await linter.lintDirectory('/path/to/your/project', '1.0.0');
68+
69+
console.log(`Linting result: ${isValid ? 'Valid' : 'Invalid'}`);
70+
```
71+
72+
Note: The linter will automatically create any necessary directories when writing files.
73+
1174
## Codebase Context Editor
1275

1376
To help you get started with creating context files for your project, we've developed the Codebase Context Editor. This tool simplifies the process of generating .context.md, .contextdocs.md, and .contextignore files that adhere to the Codebase Context Specification.
@@ -21,15 +84,6 @@ The Codebase Context Editor provides an intuitive interface for:
2184

2285
Whether you're new to the Codebase Context Specification or an experienced user, the editor can significantly streamline your workflow.
2386

24-
## Quick Links
25-
26-
- [Full Specification (CODEBASE-CONTEXT.md)](./CODEBASE-CONTEXT.md)
27-
- [GitHub Repository](https://github.com/Agentic-Insights/codebase-context-spec)
28-
- [NPM Package (codebase-context-lint)](https://www.npmjs.com/package/codebase-context-lint)
29-
- [SubStack Article by Vaskin](https://agenticinsights.substack.com/p/codebase-context-specification-rfc)
30-
- [Context File Example (.context.md)](.context.md)
31-
- [AI Assistant Prompt (CODING-ASSISTANT-PROMPT.md)](CODING-ASSISTANT-PROMPT.md)
32-
3387
## Supported Node.js Versions
3488

3589
This project supports the following Node.js versions:
@@ -59,20 +113,6 @@ By adopting this convention, teams can ensure that both human developers and AI
59113
- **Standardized Context Files**: Consistent use of `.context.md`, `.context.yaml`, and `.context.json` files for conveying codebase context at various levels (project-wide, directory-specific, etc.).
60114
- **Context-Aware Development**: Encouraging a development approach that considers and documents the broader context of code, not just its immediate functionality.
61115

62-
## Linter
63-
64-
We provide a linter to help validate your context files according to the specification. You can find the NPM package here: [codebase-context-lint](https://www.npmjs.com/package/codebase-context-lint).
65-
66-
To install the linter:
67-
68-
```bash
69-
npm install -g codebase-context-lint
70-
```
71-
72-
Note: Make sure you're using a supported Node.js version (18.x, 20.x, or 22.x) when installing and running the linter.
73-
74-
For more information on using the linter, please refer to the [linter's README](./linters/typescript/README.md).
75-
76116
## Recent Updates
77117

78118
We've recently updated our dependencies to address security vulnerabilities and improve compatibility with different Node.js versions. If you encounter any issues after updating, please report them in our GitHub issues.
@@ -122,7 +162,7 @@ All contributions will be reviewed and discussed openly. Significant changes may
122162

123163
## Version History
124164

125-
- 1.0-preview: Initial preview release of the Codebase Context Specification
165+
- 1.0.0-RFC: Initial RFC release of the Codebase Context Specification
126166

127167
## Learn More
128168

0 commit comments

Comments
 (0)