{"id":18016560,"url":"https://github.com/webassembly/wasi-cli","last_synced_at":"2025-04-06T16:14:42.987Z","repository":{"id":145105780,"uuid":"606174813","full_name":"WebAssembly/wasi-cli","owner":"WebAssembly","description":"Command-Line Interface (CLI) World for WASI","archived":false,"fork":false,"pushed_at":"2025-04-03T18:27:12.000Z","size":332,"stargazers_count":77,"open_issues_count":9,"forks_count":16,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-04-06T16:14:31.745Z","etag":null,"topics":["proposal","wasi"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WebAssembly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2023-02-24T19:16:21.000Z","updated_at":"2025-04-06T15:52:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"2c4803e1-d235-42f6-8d3e-e8905bec7d11","html_url":"https://github.com/WebAssembly/wasi-cli","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":"WebAssembly/wasi-proposal-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebAssembly%2Fwasi-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebAssembly%2Fwasi-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebAssembly%2Fwasi-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebAssembly%2Fwasi-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WebAssembly","download_url":"https://codeload.github.com/WebAssembly/wasi-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247509237,"owners_count":20950232,"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":["proposal","wasi"],"created_at":"2024-10-30T04:18:27.639Z","updated_at":"2025-04-06T16:14:42.966Z","avatar_url":"https://github.com/WebAssembly.png","language":null,"readme":"# WASI CLI World\n\nA proposed [WebAssembly System Interface](https://github.com/WebAssembly/WASI) API.\n\n### Current Phase\n\nwasi-cli is currently in [Phase 3].\n\n[Phase 3]:  https://github.com/WebAssembly/WASI/blob/main/Proposals.md#phase-3---implementation-phase-cg--wg\n\n### Champions\n\n- Dan Gohman\n\n### Portability Criteria\n\nWASI CLI must have host implementations which can pass the testsuite\non at least Windows, macOS, and Linux.\n\nWASI CLI must have at least two complete independent implementations.\n\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Goals [or Motivating Use Cases, or Scenarios]](#goals-or-motivating-use-cases-or-scenarios)\n- [Non-goals](#non-goals)\n- [API walk-through](#api-walk-through)\n  - [Use case 1](#use-case-1)\n  - [Use case 2](#use-case-2)\n- [Detailed design discussion](#detailed-design-discussion)\n  - [Should stdout be an `output-stream`?](#should-stdout-be-an-output-stream)\n  - [Should stderr be an `output-stream`?](#should-stderr-be-an-output-stream)\n  - [Should environment variables be arguments to `command`?](#should-environment-variables-be-arguments-to-command)\n- [Stakeholder Interest \u0026 Feedback](#stakeholder-interest--feedback)\n- [References \u0026 acknowledgements](#references--acknowledgements)\n\n### Introduction\n\nWasi-cli a [World] proposal for a Command-Line Interface (CLI) environment. It provides APIs commonly available in such environments, such as filesystems and sockets, and also provides command-line facilities such as command-line arguments, environment variables, and stdio.\n\n[World]: https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md#wit-worlds\n\n### Goals\n\nWasi-cli aims to be useful for:\n\n - Interactive command-line argument programs.\n\n - Servers that use filesystems, sockets, and related APIs and expect to be started with\n   a CLI-style command-line.\n\n - Stream filters that read from standard input and write to standard output.\n\n### Non-goals\n\nWasi-cli is not aiming to significantly re-imagine the concept of command-line interface programs. While WASI as a whole is exploring ideas such as [Typed Main], wasi-cli sticks to the traditional list-of-strings style command-line arguments.\n\n[Typed Main]: https://sunfishcode.github.io/typed-main-wasi-presentation/\n\n### API walk-through\n\nThe full API documentation can be found [here](command.md).\n\nTODO [Walk through of how someone would use this API.]\n\n#### [Use case 1]\n\n[Provide example code snippets and diagrams explaining how the API would be used to solve the given problem]\n\n#### [Use case 2]\n\n[etc.]\n\n### Detailed design discussion\n\n#### Should stdout be an `output-stream`?\n\nFor server use cases, standard output (stdout) is typically used as a log,\nwhere it's typically not meaningfully blocking, async, or fallible. It's just\na place for the program to send messages to and forget about them. One option\nwould be to give such use cases a dedicated API, which would have a single\nfunction to allow printing strings that doesn't return a `result`, meaning it\nnever fails.\n\nHowever, it'd only be a minor simplification in practice, and dedicated cloud\nor edge use cases should ideally migrate to more specialized worlds than the\nwasi-cli world anyway, as they can result in much greater simplifications, so\nthis doesn't seem worthwhile.\n\n#### Should stderr be an `output-stream`?\n\nThis is similar to the question for stdout, but for standard error (stderr),\nit's a little more tempting to do something like this because stderr is used\nin this logging style by many kinds of applications.\n\nHowever, it seems better overall to keep stderr consistent with stdout, and\nfocus our desires for simplification toward other worlds, which can achieve\neven greater simplifications.\n\n#### Should environment variables be arguments to `command`?\n\nEnvironment variables are useful in some non-cli use cases, so leaving them\nas separate imports means they can be used from worlds that don't have a\n`command` entrypoint.\n\n### Stakeholder Interest \u0026 Feedback\n\nTODO before entering Phase 3.\n\n[This should include a list of implementers who have expressed interest in implementing the proposal]\n\n### References \u0026 acknowledgements\n\nThe concept of wasi-cli has been in development for over a year since the proposal is\nposted here, and many people have contributed ideas that have influenced.  Many thanks\nfor valuable feedback and advice in particular from:\n\n- Luke Wagner\n- Pat Hickey\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebassembly%2Fwasi-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebassembly%2Fwasi-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebassembly%2Fwasi-cli/lists"}