{"id":21191759,"url":"https://github.com/edgeimpulse/edge-impulse-cli","last_synced_at":"2025-07-10T03:31:05.131Z","repository":{"id":39990572,"uuid":"274100691","full_name":"edgeimpulse/edge-impulse-cli","owner":"edgeimpulse","description":"Command line interface tools for Edge Impulse","archived":false,"fork":false,"pushed_at":"2024-03-14T13:30:50.000Z","size":2830,"stargazers_count":13,"open_issues_count":23,"forks_count":13,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-04-30T05:16:32.007Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/edgeimpulse.png","metadata":{"files":{"readme":"README-blocks.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}},"created_at":"2020-06-22T09:55:26.000Z","updated_at":"2024-06-24T12:14:25.552Z","dependencies_parsed_at":"2024-03-14T14:53:19.978Z","dependency_job_id":"22642e57-a7b5-42f9-a232-6f654a011566","html_url":"https://github.com/edgeimpulse/edge-impulse-cli","commit_stats":{"total_commits":63,"total_committers":3,"mean_commits":21.0,"dds":"0.47619047619047616","last_synced_commit":"97ec808779abd1e8cd52b15c5652cf9ea16fd5f9"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edgeimpulse%2Fedge-impulse-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edgeimpulse%2Fedge-impulse-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edgeimpulse%2Fedge-impulse-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edgeimpulse%2Fedge-impulse-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edgeimpulse","download_url":"https://codeload.github.com/edgeimpulse/edge-impulse-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225169449,"owners_count":17431876,"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-20T19:05:10.866Z","updated_at":"2024-11-20T19:05:11.462Z","avatar_url":"https://github.com/edgeimpulse.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Edge Impulse Blocks\n\nThe blocks CLI tool creates [transformation](https://docs.edgeimpulse.com/docs/creating-a-transformation-block) or [deployment](https://docs.edgeimpulse.com/docs/building-deployment-blocks) blocks that can be used by organizations. With the blocks CLI tool you can create new blocks and push them to Edge Impulse. Blocks can be written in any language, and are based on Docker containers, but you don't need to have any Docker tooling installed - building the containers happens in Edge Impulse.\n\n## Transformation blocks\n\nFor a tutorial on transformation blocks see: [Docs: Creating a transformation block](https://docs.edgeimpulse.com/docs/creating-a-transformation-block).\n\nYou create a new transformation block by running:\n\n```\n$ edge-impulse-blocks init\n? What is your user name or e-mail address (edgeimpulse.com)? jan@edgeimpulse.com\n? What is your password? [hidden]\n? In which organization do you want to create this block? EdgeImpulse Inc.\nAttaching block to organization 'EdgeImpulse Inc.'\n? Choose a type of block Transformation block\n? Choose an option Create a new block\n? Enter the name of your block Extract voice\n? Enter the description of your block Extracts voice from video files\nCreating block with config: {\n  name: 'Extract voice',\n  type: 'transform',\n  description: 'Extracts voice from video files',\n  organizationId: 4\n}\n? Would you like to download and load the example repository (Python)? yes\nTemplate repository fetched!\nYour new block 'Extract voice' has been created in '/Users/janjongboom/repos/custom-transform-block'.\nWhen you have finished building your transformation block, run \"edge-impulse-blocks push\" to update the block in Edge Impulse.\n```\n\nWhen you're done developing the block you can push it to Edge Impulse via:\n\n```\n$ edge-impulse-blocks push\nArchiving 'custom-transform-block'...\nArchiving 'custom-transform-block' OK (2 KB)\n\nUploading block 'Extract voice' to organization 'EdgeImpulse Inc.'...\nUploading block 'Extract voice' to organization 'EdgeImpulse Inc.' OK\n\nBuilding transformation block 'Extract voice'...\nINFO[0000] Retrieving image manifest python:3.7.5-stretch\nINFO[0000] Retrieving image python:3.7.5-stretch\n\n...\n\nBuilding transformation block 'Extract voice' OK\n\nYour block has been updated, go to https://studio.edgeimpulse.com/organization/4/data to run a new transformation\n```\n\nThe metadata about the block (which organization it belongs to, block ID) is saved in `.ei-block-config`, which you should commit.\n\n## Deployment blocks\n\nFor a tutorial on deployment blocks see: [Docs: Building deployment blocks](https://docs.edgeimpulse.com/docs/building-deployment-blocks).\n\nYou create a new deployment block by running:\n\n```\n$ edge-impulse-blocks init\n? What is your user name or e-mail address (edgeimpulse.com)? jan@edgeimpulse.com\n? What is your password? [hidden]\n? In which organization do you want to create this block? EdgeImpulse Inc.\nAttaching block to organization 'EdgeImpulse Inc.'\n? Choose a type of block Deployment block\n? Choose an option Create a new block\n? Enter the name of your block Custom deployment\n? Enter the description of your block A custom deployment\nCreating block with config: {\n  name: 'Custom deployment',\n  type: 'deploy',\n  description: 'A custom deployment',\n  organizationId: 4\n}\n? Would you like to download and load the example repository? yes\nTemplate repository fetched!\nYour new block 'Custom deployment' has been created in '/Users/janjongboom/repos/custom-deploy-block'.\nWhen you have finished building your deploy block, run 'edge-impulse-blocks push' to update the block in Edge Impulse.\n```\n\nWhen you're done developing the block you can push it to Edge Impulse via:\n\n```\n$ edge-impulse-blocks push\nArchiving 'custom-deploy-block'...\nArchiving 'custom-deploy-block' OK (2 KB)\n\nUploading block 'Custom deployment' to organization 'EdgeImpulse Inc.'...\nUploading block 'Custom deployment' to organization 'EdgeImpulse Inc.' OK\n\nBuilding deploy block 'Custom deployment'...\nINFO[0000] Retrieving image manifest python:3.7.5-stretch\nINFO[0000] Retrieving image python:3.7.5-stretch\n\n...\n\nBuilding deploy block 'Custom deployment' OK\n\nYour block has been updated, go to https://studio.edgeimpulse.com/organization/4/deployment to create a new deployment\n```\n\nThe metadata about the block (which organization it belongs to, block ID) is saved in `.ei-block-config`, which you should commit.\n\n## Block structure\n\nCustom blocks use Docker containers, a virtualization technique which lets developers package up an application with all dependencies in a single package. Thus, every block needs at least a `Dockerfile`. This is a file describing how to build the container that powers the block, and it has information about the dependencies for the block - like a list of Python packages your block needs. This `Dockerfile` needs to declare an `ENTRYPOINT`: a command that needs to run when the container starts.\n\nAn example of a Python container is:\n\n```\nFROM python:3.7.5-stretch\n\nWORKDIR /app\n\n# Python dependencies\nCOPY requirements.txt ./\nRUN pip3 --no-cache-dir install -r requirements.txt\n\nCOPY . ./\n\nENTRYPOINT [ \"python3\",  \"transform.py\" ]\n```\n\nWhich takes a base-image with Python 3.7.5, then installs all dependencies listed in `requirements.txt`, and finally starts a script called `transform.py`.\n\n**Note:** Do not use a WORKDIR under /home! The /home path will be mounted in by Edge Impulse, making your files inaccessible.\n\n**Note**: If you use a different programming language, make sure to use `ENTRYPOINT` to specify the application to execute, rather than `RUN` or `CMD`.\n\nBesides your `Dockerfile` you'll also need the application files, in the example above `transform.py` and `requirements.txt`. You can place these in the same folder.\n\n## Excluding files\n\nWhen pushing a new block all files in your folder are archived and sent to Edge Impulse, where the container is built. You can exclude files by creating a file called `.dockerignore` in the root folder of your block. You can either set absolute paths here, or use wildcards to exclude many files. For example:\n\n```\na-large-folder/*\nsome-path-to-a-text-file.txt\n```\n\nThe full spec for this file is here: [Dockerignore](https://docs.docker.com/engine/reference/builder/#dockerignore-file).\n\n### Clearing configuration\n\nTo clear the configuration, run:\n\n```\n$ edge-impulse-blocks --clean\n```\n\nThis resets the CLI configuration and will prompt you to log in again.\n\n### API Key\n\nYou can use an API key to authenticate with:\n\n```\n$ edge-impulse-blocks --api-key ei_...\n```\n\nNote that this resets the CLI configuration and automatically configures your organization.\n\n### Other options\n\n* `--dev` - lists development servers, use in conjunction with `--clean`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedgeimpulse%2Fedge-impulse-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedgeimpulse%2Fedge-impulse-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedgeimpulse%2Fedge-impulse-cli/lists"}