scriptor-ai
v1.0.3
Published
AI‑powered CLI and GitHub Action for generating code documentation and examples using OpenAI LLMs.
Downloads
15
Maintainers
Readme
Scriptor
Scriptor is your AI‑driven “Docs CI/CD” for codebases: continuously generate, validate, and enrich Markdown docs, code examples, and diagram, directly in your CLI, IDE, or web portal.
“Make documentation as effortless, reliable and dynamic as writing code.”
Table of Contents
Features
- Continuous Documentation: GitHub Action or CLI plugin auto‑comments PRs with fresh docs.
- Multi‑Prompt Agent:
function-summary,module-overview,changelogtemplates, hot‑reloadable viaPromptManager. - Streaming & Large Context: Leverage GPT‑4.1’s 1 M token window and streaming API for real‑time feedback.
- IDE Integrations: VS Code & JetBrains plugins for inline docs.
- Web Portal: (“Scriptor Hub”) TBD, for cross‑functional stakeholders.
Getting Started
Prerequisites
- Node.js ≥ 18 LTS
- npm or yarn
- OpenAI API key (for local dev via
.env)
Installation
git clone https://github.com/xcoder-nz/scriptor.git
cd scriptor
npm installCreate a .env file at project root:
echo "OPENAI_API_KEY=sk-…" > .envUsage
CLI
# Summarize a function
npx ts-node cli/generate.ts generate function-summary --file examples/foo.py
# Module overview
npx ts-node cli/generate.ts generate module-overview --file examples/analytics.py
# Changelog
npx ts-node cli/generate.ts generate changelog --file examples/change.diffGitHub Action
Add to .github/workflows/docs.yml:
on: [pull_request]
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: xcoder-nz/scriptor-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}Prompt Templates
Located in cli/prompts/:
- function-summary.txt: Summarizes single functions.
- module-overview.txt: Lists classes/methods in tables.
- changelog.txt: Generates Markdown changelogs from diffs.
Edit these .txt files on‑the‑fly—no recompilation required.
Testing
npm test # runs Jest unit & integration tests
npm run lint # ESLint checks
npm run type # TypeScript compiler checksCI is configured in .github/workflows/ci.yml to run tests on push and PR citeturn0search4.
Roadmap
See ROADMAP.md for upcoming milestones: v1.0 IDE plugins, v1.1 Web Portal, Enterprise features.
Contributing
- Fork the repo
- Create a feature branch (
git checkout -b feat/name) - Run tests (
npm test) - Open a PR and reference this issue
Please follow the Standard Readme Spec.
License
MIT © XCoder NZ
