{"id":18246705,"url":"https://github.com/scrypt-inc/scrypt-cli","last_synced_at":"2025-04-04T14:31:20.807Z","repository":{"id":65057553,"uuid":"580751137","full_name":"sCrypt-Inc/scrypt-cli","owner":"sCrypt-Inc","description":"CLI tool for creating and managing sCrypt projects.","archived":false,"fork":false,"pushed_at":"2025-02-28T06:55:26.000Z","size":2602,"stargazers_count":8,"open_issues_count":13,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-31T08:16:51.596Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sCrypt-Inc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2022-12-21T11:01:43.000Z","updated_at":"2025-02-28T06:52:45.000Z","dependencies_parsed_at":"2023-11-18T14:57:12.306Z","dependency_job_id":"21d1dedd-c119-43e3-804c-8c8cf5d25cdc","html_url":"https://github.com/sCrypt-Inc/scrypt-cli","commit_stats":{"total_commits":113,"total_committers":3,"mean_commits":"37.666666666666664","dds":"0.49557522123893805","last_synced_commit":"fb19ea63d34e6d17e180a8e6c0c4e4ab88c587b5"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sCrypt-Inc%2Fscrypt-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sCrypt-Inc%2Fscrypt-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sCrypt-Inc%2Fscrypt-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sCrypt-Inc%2Fscrypt-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sCrypt-Inc","download_url":"https://codeload.github.com/sCrypt-Inc/scrypt-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247194000,"owners_count":20899409,"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-11-05T09:27:22.870Z","updated_at":"2025-04-04T14:31:20.335Z","avatar_url":"https://github.com/sCrypt-Inc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sCrypt CLI\n\nA CLI tool to make development of sCrypt faster and easier.\n\n[![Build Status](https://travis-ci.com/sCrypt-Inc/scrypt-cli.svg?branch=master)](https://travis-ci.com/sCrypt-Inc/scrypt-cli)\n\n## Usage\n\n\u003e**Note:**\n\u003eNode version 16 or greater is required.\n\n### Create a new sCrypt smart contract project\n\n```sh\nnpx scrypt-cli project my-proj\n```\n \n or simply\n\n```sh\nnpx scrypt-cli p my-proj\n```\n\nThe command creates a new directory `my-proj` which contains a demo sCrypt smart contract along with needed scaffolding. \n\nRead the projects `README.md` for more info on how to test and deploy the generated smart contract.\n\nYou can also use the following command to generate a stateful smart contract project:\n\n```sh\nnpx scrypt-cli p --state my-proj\n```\n\nLastly, you can create an sCrypt library project with the following option:\n\n```sh\nnpx scrypt-cli p --lib my-lib\n```\n\n\n### Compile sCrypt smart contracts\n\n```sh\nnpx scrypt-cli compile\n```\n\n\nThis will search current project for classes extending `SmartContract` and compile them. This will produce a [contract artifact file](https://github.com/sCrypt-Inc/scryptlib#contract-description-file) for each compiled class. The files will be stored under the `artifacts` directory. \n\nThe command needs to run in the root directory of the project.\n\n\n### Compile sCrypt Smart Contract under Watch\n\n```sh\nnpx scrypt-cli compile --watch\n```\nInitiate smart contract compilation in watch mode. This mode allows you to observe real-time updates and notifications regarding any errors specific to the smart contract compilation phase, which are distinct from TypeScript errors. During watch mode, smart contracts get automatically compiled after a change is made to any of the smart contract source files.\n\n### Compile using the --asm option\n\n```sh\nnpx scrypt-cli compile --asm\n```\nThe `--asm` option is used to apply inline assembly optimizations. These are defined under the `.asm/` directory in the root of the project (auto genereted when using `--asm` option with the `project` command).\nRead more in [the docs](https://docs.scrypt.io/advanced/inline-asm).\n\n### Deploy sCrypt smart contracts\n\n```sh\nnpx scrypt-cli deploy\n```\n\nThis will create a deployment script template `deploy.ts` if it doesn't exist yet. If it does it executes it. Projects generated using the sCrypt CLI will already have `deploy.ts` present.\n\n\nYou can also run a deployment script with a different name using the `f` option:\n```sh\nnpx scrypt-cli deploy -f myDeployScript.ts\n```\n\n### Verify a deployed smart contract\n\nWith the `verify` you can verify that a already deployed output script was produced by the specified sCrypt code.\n\n```sh\nnpx scrypt-cli verify \u003cscriptHash\u003e \u003ccontractPath\u003e\n```\n\nThe first positional argument is the double-SHA256 hash of the deployed output script, commonly used by block explorers to index scripts. The second one is the path to the file which contains the sCrypt smart contract. Note, that the file must also include all the code it depends on, i.e. third party libraries. \n\nUsing the `network` option, you can specify on which network the contract is deployed. This defaults to `test`, indicating the Bitcoin testnet:\n\n```sh\nnpx scrypt-cli verify --network main \u003cscriptHash\u003e \u003ccontractPath\u003e\n```\n\nYou can also specify the version of sCrypt used during verification. By default, the command will use the version specified in `package.json`:\n\n```sh\nnpx scrypt-cli verify -V 0.2.1-beta.9 \u003cscriptHash\u003e \u003ccontractPath\u003e\n```\n\n### Get system info\n\nWhen filing an issue a lot of time it's useful to provide information about your system. You can get this information with the following command:\n\n```sh\nnpx scrypt-cli system\n```\n\n\n### Show version\n\nShow the version of scrypt-cli:\n\n```sh\nnpx scrypt-cli -v\n```\n\n### Using latest version\n\n1. run command with `latest` tag: \n\n```sh\nnpx scrypt-cli@latest -v\n```\n\nor \n\n2. clear cache to fetch the latest version: \n\n```sh\nnpx clear-npx-cache\nnpx scrypt-cli -v\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscrypt-inc%2Fscrypt-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscrypt-inc%2Fscrypt-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscrypt-inc%2Fscrypt-cli/lists"}