---
title: "Build a Cross-Platform CLI with Deno in 5 minutes"
description: "Deno's built-in tooling covers the full path to a small cross-platform CLI, shown here by building `greetme-cli`."
url: "https://swe.quest/articles/build-a-cross-platform-cli-with-deno-in-5-minutes-fef7ea1fb4bc76d2"
canonical: "https://deno.com/blog/build-cross-platform-cli"
source: "Deno"
published: "2023-09-01"
difficulty: "medium"
kind: "How-to"
reading_minutes: 9
tags: ["typescript","developer-tools","javascript","testing"]
---

# Build a Cross-Platform CLI with Deno in 5 minutes

A post on [Deno](https://swe.quest/sources/deno.md), published 2023-09-01, 9 min read, How-to. Original: [https://deno.com/blog/build-cross-platform-cli](https://deno.com/blog/build-cross-platform-cli)

## Summary

Deno's built-in tooling covers the full path to a small cross-platform CLI, shown here by building \`greetme-cli\`. The std \`flags\` module's \`parse()\` handles argument parsing with typed flags, aliases and defaults. Deno KV persists settings across runs and needs an explicit path when compiled, and the web \`prompt()\` API handles interactive input. The tutorial finishes with \`Deno.test\` for unit tests and \`deno compile\` to ship a single executable binary, noting the required \`--unstable\`, \`--allow-read\` and \`--allow-write\` flags.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [TypeScript](https://swe.quest/tags/typescript.md) (Languages)
- [Developer tools](https://swe.quest/tags/developer-tools.md) (Engineering practices)
- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)
- [Testing](https://swe.quest/tags/testing.md) (Engineering practices)

## Prerequisites

- TypeScript basics ([easy posts on TypeScript](https://swe.quest/tags/typescript.md?difficulty=easy))
- command-line usage

## Keywords

Deno, Deno KV, deno compile, Deno standard library, Deno.test

## Related posts

- [Deno 1.34: deno compile supports npm packages](https://swe.quest/articles/deno-1-34-deno-compile-supports-npm-packages-6066648b7bf9ee04.md): Deno · 2023-05-25 · Medium · 6 min read · JavaScript, Runtimes & VMs, Developer tools, TypeScript
  Deno 1.34 lets \`deno compile\` bundle npm packages and their dependencies into a single self-contained executable.
- [Deno 2.5: Permissions in the config file](https://swe.quest/articles/deno-2-5-permissions-in-the-config-file-6c1646b356167f76.md): Deno · 2025-09-10 · Medium · 13 min read · JavaScript, TypeScript, Runtimes & VMs, Developer tools, Testing
  Deno 2.5 adds named permission sets in deno.json, selectable with -P or --permission-set, plus per-command permissions for test, bench and compile that require -P to apply.
- [Deno 2.6: dx is the new npx](https://swe.quest/articles/deno-2-6-dx-is-the-new-npx-58f73c73a151bd8c.md): Deno · 2025-12-10 · Medium · 16 min read · JavaScript, TypeScript, Runtimes & VMs, Supply chain security, Developer tools
  Deno 2.6 adds \`dx\`, an npx equivalent for running npm and JSR package binaries that defaults to full permissions, prompts before download and runs lifecycle scripts.
- [Deno 2.3: Improved deno compile, local npm packages, and more](https://swe.quest/articles/deno-2-3-improved-deno-compile-local-npm-packages-and-more-8da91030a8445369.md): Deno · 2025-05-01 · Medium · 11 min read · JavaScript, TypeScript, Runtimes & VMs, Developer tools, Observability
  Deno 2.3 lets deno compile bundle programs that use FFI and Node native add-ons, adds --include/--exclude control over embedded files, and exposes Deno.build.standalone to detect compiled binaries.
- [Build a REST API with Express, TypeScript, and Deno](https://swe.quest/articles/build-a-rest-api-with-express-typescript-and-deno-803b55a783fab19e.md): Deno · 2023-03-08 · Medium · 5 min read · TypeScript, JavaScript, API design, Runtimes & VMs
  Deno runs Express with TypeScript without any TypeScript build configuration: Express is imported through an npm: specifier and its types are pulled in with a @deno-types comment.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
