{"id":13595465,"url":"https://github.com/pyscript/pyscript-cli","last_synced_at":"2025-05-16T01:05:39.560Z","repository":{"id":37104629,"uuid":"487610163","full_name":"pyscript/pyscript-cli","owner":"pyscript","description":"A CLI for PyScript","archived":false,"fork":false,"pushed_at":"2025-04-30T22:18:48.000Z","size":174,"stargazers_count":166,"open_issues_count":15,"forks_count":25,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-04-30T23:26:04.708Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/pyscript.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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}},"created_at":"2022-05-01T18:19:14.000Z","updated_at":"2025-04-02T03:48:41.000Z","dependencies_parsed_at":"2024-01-16T22:18:28.167Z","dependency_job_id":"f4ddc110-31c4-4de8-860e-2e96c4f0abb9","html_url":"https://github.com/pyscript/pyscript-cli","commit_stats":{"total_commits":91,"total_committers":9,"mean_commits":10.11111111111111,"dds":0.4505494505494505,"last_synced_commit":"701fec645af3d141b8fd68959351249bd7deb041"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyscript%2Fpyscript-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyscript%2Fpyscript-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyscript%2Fpyscript-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyscript%2Fpyscript-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyscript","download_url":"https://codeload.github.com/pyscript/pyscript-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254448579,"owners_count":22072764,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-08-01T16:01:50.493Z","updated_at":"2025-05-16T01:05:34.538Z","avatar_url":"https://github.com/pyscript.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# PyScript CLI\n\nA command-line interface for [PyScript](https://pyscript.net).\n\n\n[![Version](https://img.shields.io/pypi/v/pyscript.svg)](https://pypi.org/project/pyscript/)\n[![Test](https://github.com/pyscript/pyscript-cli/actions/workflows/test.yml/badge.svg)](https://github.com/pyscript/pyscript-cli/actions/workflows/test.yml)\n[![codecov](https://codecov.io/gh/pyscript/pyscript-cli/branch/main/graph/badge.svg?token=dCxt9oBQPL)](https://codecov.io/gh/pyscript/pyscript-cli)\n[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/pyscript/pyscript-cli/main.svg)](https://results.pre-commit.ci/latest/github/pyscript/pyscript-cli/main)\n[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)\n\nQuickly wrap Python scripts into a HTML template, pre-configured with [PyScript](https://pyscript.net).\n\n```bash\n❯ pyscript\n\n Usage: pyscript [OPTIONS] COMMAND [ARGS]...\n\n Command Line Interface for PyScript.\n\n╭─ Options ──────────────────────────────────────────────────────────────────────────────────────╮\n│ --version          Show project version and exit.                                              │\n│ --help             Show this message and exit.                                                 │\n╰────────────────────────────────────────────────────────────────────────────────────────────────╯\n╭─ Commands ─────────────────────────────────────────────────────────────────────────────────────╮\n│ create  Create a new pyscript project with the passed in name, creating a new directory in the │\n│         current directory. Alternatively, use `--wrap` so as to embed a python file instead.   │\n│ run     Creates a local server to run the app on the path and port specified.                  │\n╰────────────────────────────────────────────────────────────────────────────────────────────────╯\n\n```\n\n## Installation\n\n### Using Pip\n\n```shell\n$ pip install pyscript\n```\n\n### Installing the developer setup from the a repository clone\n\n\n[see the Developer setup section on CONTRIBUTING page](CONTRIBUTING.md)\n\n## Usage\n\n### run\n\n#### Spin up a local server to run on the path and specified port\n\n```shell\n$ pyscript run \u003cpath_of_folder\u003e\n```\n\nThis will serve the folder `path_of_folder` at `localhost:8000` by default\nand will open the URL in a browser window. Default is current directory if\n`path_of_folder` is not supplied.\n\nTo use a different port, use `--port` option.\n\n```shell\n$ pyscript run \u003cpath_of_folder\u003e --port 9000\n```\n\nTo avoid opening a browser window, use `--no-view` option.\n\n```shell\n$ pyscript run \u003cpath_of_folder\u003e --no-view\n```\n\n### create\n\n#### Create a new pyscript project with the passed in name, creating a new directory\n\n```shell\n$ pyscript create \u003cname_of_app\u003e\n```\n\nThis will create a new directory named `name_of_app` under the current directory.\n\nThe interactive prompts will further ask for information such as `description of the app`,\n`name of the author`, `email of the author`, etc. These of course can be provided via\noptions such as `--author-name` etc. Use `pyscript create --help` for more information.\n\nThe following files will be created:\n\n- `index.html`: start page for the project\n- `pyscript.toml`: project metadata and config file\n- `main.py`: a \"Hello world\" python starter module\n\n#### Use --wrap to embed a python file OR a command string\n\n- ##### Embed a Python script into a PyScript HTML file\n\n```shell\n$ pyscript create --wrap \u003cfilename.py\u003e\n```\n\nThis will generate a project i.e. a new directory named `filename` under the current directory.\n\nSimilar to the above, interactive prompts will further ask for metadata information.\n\nThe following files will be created:\n\n- `index.html`: start page for the project\n- `pyscript.toml`: project metadata and config file\n- `main.py`: contains code of `filename.py`\n\nThis can be overridden with the `-o` or `--output` option:\n\n```shell\n$ pyscript create --wrap \u003cfilename.py\u003e -o \u003canother_filename.html\u003e\n```\n\ni.e. the HTML file created in the above directory will now be named `another_filename.html`\n\n- ##### Very simple command examples with `--command` option\n\nThe `-c` or `--command` option can be used to demo very simple cases.\n\nBy default, the name of the project folder created will be `pyscript-command-app` with the HTML file named `index.html`.\n\n`-o/--output` option can be used with the `-c/--command` option to configure name of the project folder as well\nas the name of the resulting HTML file.\n\n```shell\n$ pyscript create --wrap -c 'print(\"Hello World!\")' -o \u003coutput_filename.html\u003e\n```\n\nThis will generate a project i.e. a new directory named `output_filename` under the current directory.\n\nSimilar to the above, interactive prompts will further ask for metadata information.\n\nThe following files will be created:\n\n- `output_filename.html`: start page for the project\n- `pyscript.toml`: project metadata and config file\n- `main.py`: contains code of the command string passed via `-c/--command`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyscript%2Fpyscript-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyscript%2Fpyscript-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyscript%2Fpyscript-cli/lists"}