{"id":21473410,"url":"https://github.com/cedarscript/cedarscript-editor-python","last_synced_at":"2026-02-27T11:02:32.767Z","repository":{"id":257811319,"uuid":"868025911","full_name":"CEDARScript/cedarscript-editor-python","owner":"CEDARScript","description":"A runtime engine for CEDARScript, a SQL-like language for code analysis and transformations","archived":false,"fork":false,"pushed_at":"2025-11-21T18:27:39.000Z","size":298,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-21T20:27:14.464Z","etag":null,"topics":["ai-assisted-development","code-editor","interpreter","runtime","sql-like"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CEDARScript.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-10-05T09:25:58.000Z","updated_at":"2025-11-21T18:27:43.000Z","dependencies_parsed_at":"2024-10-05T12:38:24.933Z","dependency_job_id":"397c04f5-7a47-420c-b5aa-2d1ebbe66f5a","html_url":"https://github.com/CEDARScript/cedarscript-editor-python","commit_stats":null,"previous_names":["cedarscript/cedarscript-editor","cedarscript/cedarscript-editor-python"],"tags_count":48,"template":false,"template_full_name":null,"purl":"pkg:github/CEDARScript/cedarscript-editor-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CEDARScript%2Fcedarscript-editor-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CEDARScript%2Fcedarscript-editor-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CEDARScript%2Fcedarscript-editor-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CEDARScript%2Fcedarscript-editor-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CEDARScript","download_url":"https://codeload.github.com/CEDARScript/cedarscript-editor-python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CEDARScript%2Fcedarscript-editor-python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29892063,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T09:48:51.284Z","status":"ssl_error","status_checked_at":"2026-02-27T09:48:43.992Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ai-assisted-development","code-editor","interpreter","runtime","sql-like"],"created_at":"2024-11-23T10:17:04.660Z","updated_at":"2026-02-27T11:02:32.759Z","avatar_url":"https://github.com/CEDARScript.png","language":"Python","readme":"# CEDARScript Editor (Python)\n\n[![PyPI version](https://badge.fury.io/py/cedarscript-editor.svg)](https://pypi.org/project/cedarscript-editor/)\n[![Python Versions](https://img.shields.io/pypi/pyversions/cedarscript-editor.svg)](https://pypi.org/project/cedarscript-editor/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n`CEDARScript Editor (Python)` is a [CEDARScript](https://bit.ly/cedarscript) runtime\nfor interpreting `CEDARScript` scripts and performing code analysis and modification operations on a codebase.\n\nCEDARScript enables offloading _low-level code syntax and structure concerns_, such as indentation and line counting,\nfrom the LLMs.\nThe CEDARScript runtime _bears the brunt of file editing_ by locating the exact line numbers and characters to change,\nwhich indentation levels to apply to each line and so on, allowing the _CEDARScript commands_ to focus instead on \n**higher levels of abstraction**, like identifier names, line markers, relative indentations and positions\n(`AFTER`, `BEFORE`, `INSIDE` a function, its `BODY`, at the `TOP` or `BOTTOM` of it...).\n\nIt acts as an _intermediary_ between the **LLM** and the **codebase**, handling the low-level details of code\nmanipulation and allowing the AI to focus on higher-level tasks.\n\n## What is CEDARScript?\n\n[CEDARScript](https://github.com/CEDARScript/cedarscript-grammar#readme) (_Concise Examination, Development, And Refactoring Script_)\nis a domain-specific language that aims to improve how AI coding assistants interact with codebases and communicate\ntheir code modification intentions.\n\nIt provides a standardized way to express complex code modification and analysis operations, making it easier for\nAI-assisted development tools to understand and execute these tasks.\n\n## Features\n\n- Given a `CEDARScript` script and a base directory, executes the script commands on files inside the base directory;\n- Return results in `XML` format for easier parsing and processing by LLM systems\n\n## Installation\n\nYou can install `CEDARScript` Editor using pip:\n\n```\npip install cedarscript-editor\n```\n\n## Usage\n\n### Python Library\n\nHere's a quick example of how to use `CEDARScript` Editor as a Python library:\n\n```python\nfrom cedarscript_editor import CEDARScriptEditor\n\neditor = CEDARScriptEditor(\"/path/to/project\")\n\n# Parse and execute CEDARScript commands\ncedarscript = \"\"\"```CEDARScript\nCREATE FILE \"example.py\" WITH\n\"\"\"\nprint(\"Hello, World!\")\n\"\"\"\n```\"\"\"\n\n# Apply commands to the codebase\nresults = editor.apply_cedarscript(cedarscript)\nprint(results)\n```\n\n### Command Line Interface\n\n`cedarscript-editor` also provides a CLI for executing CEDARScript commands directly from the command line.\n\n#### Installation\n\nAfter installing via pip, the `cedarscript` command will be available:\n\n```bash\npip install cedarscript-editor\n```\n\n#### Basic Usage\n\n```bash\n# Execute CEDARScript directly\ncedarscript 'CREATE FILE \"example.py\" WITH \"print(\\\"Hello World\\\")\"'\n\n# Read CEDARScript from file\ncedarscript -f commands.cedar\ncedarscript --file commands.cedar\n\n# Read from STDIN\ncat commands.cedar | cedarscript\necho 'UPDATE FILE \"test.py\" INSERT LINE 1 \"import os\"' | cedarscript\n\n# Specify base directory\ncedarscript --root /path/to/project -f commands.cedar\n\n# Quiet mode for scripting\ncedarscript --quiet -f commands.cedar\n\n# Syntax check only\ncedarscript --check -f commands.cedar\n```\n\n#### CLI Options\n\n- `-f, --file FILENAME`: Read CEDARScript commands from file\n- `--root DIRECTORY`: Base directory for file operations (default: current directory)\n- `-q, --quiet`: Minimal output (for scripting)\n- `--check`: Syntax check only - parse commands without executing\n- `COMMAND`: Direct CEDARScript command (alternative to file input)\n\n#### CEDARScript File Format\n\nCEDARScript commands must be enclosed in fenced code blocks:\n\n````markdown\n```CEDARScript\nCREATE FILE \"example.py\" WITH\n\"\"\"\nprint(\"Hello, World!\")\n\"\"\"\n```\n````\n\nOr use the `\u003cNOCEDARSCRIPT/\u003e` tag for direct command execution:\n\n```cedarscript\n\u003cNOCEDARSCRIPT/\u003e\nCREATE FILE \"example.py\" WITH\n\"\"\"\nprint(\"Hello, World!\")\n\"\"\"\n```\n\n#### Examples\n\n**Create a new file:**\n```bash\ncedarscript '```CEDARScript\nCREATE FILE \"utils.py\" WITH\n\"\"\"\ndef hello():\n    print(\"Hello from utils!\")\n\"\"\"\n```'\n```\n\n**Update an existing file:**\n```bash\ncat \u003e update_commands.cedar \u003c\u003c 'EOF'\n```CEDARScript\nUPDATE FILE \"app.py\"\nINSERT LINE 1\n    \"\"\"Application module\"\"\"\nINSERT AFTER \"import os\"\n    import sys\n```'\nEOF\n\ncedarscript -f update_commands.cedar\n```\n\n**Multi-file operations:**\n```bash\ncat \u003e refactor.cedar \u003c\u003c 'EOF'\n```CEDARScript\n# Move method to top level\nUPDATE CLASS \"DataProcessor\"\nFROM FILE \"data.py\"\nMOVE METHOD \"process\"\n\n# Update call sites\nUPDATE FUNCTION \"main\"\nFROM FILE \"main.py\"\nREPLACE LINE 5\n    result = process(data)\n```'\nEOF\n\ncedarscript --root ./my-project -f refactor.cedar\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## See Also\n\n- https://github.com/oraios/serena\n\n## License\n\nThis project is licensed under the MIT License.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedarscript%2Fcedarscript-editor-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcedarscript%2Fcedarscript-editor-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedarscript%2Fcedarscript-editor-python/lists"}