### Git and path usage Source: https://github.com/cyber-nomad-collective/beskid/blob/main/site/website/src/content/docs/platform-spec/tooling/project-scaffolding/project-templates/examples.mdx CLI commands for creating new projects using local templates, git repositories, and installed templates. ```bash beskid new --path ./local-templates/console -n Demo -o ./Demo beskid new --git https://example.com/templates.git --git-ref v1.2.0 --git-subpath console -n Demo -o ./Demo beskid new install beskid.templates.console ``` -------------------------------- ### Layout Example Source: https://github.com/cyber-nomad-collective/beskid/blob/main/site/website/src/content/docs/book/reference/workspace-monorepo.md Example directory structure for a workspace monorepo. ```text Workspace.proj compiler/Project.proj compiler/corelib/beskid_corelib/Project.proj tools/Project.proj ``` -------------------------------- ### CI environment Source: https://github.com/cyber-nomad-collective/beskid/blob/main/site/website/src/content/docs/platform-spec/core-library/compiler-integration/corelib-injection-and-resolution/examples.mdx Ensures consistent corelib root when not using bundled install artifacts. ```bash export BESKID_CORELIB_ROOT=/path/to/compiler/corelib beskid build --project apps/demo/Project.proj ``` -------------------------------- ### Publish with API key Source: https://github.com/cyber-nomad-collective/beskid/blob/main/site/website/src/content/docs/platform-spec/tooling/registry-client/pckg-client-contract/examples.mdx Exact subcommand names follow `PckgCommand` in `cli.rs` (use `beskid pckg --help` in installed CLI). ```bash export BESKID_PCKG_URL=https://pckg.example/ export BESKID_PCKG_API_KEY=... beskid pckg upload path/to/package.bpk ``` -------------------------------- ### Setup Environment Script Source: https://github.com/cyber-nomad-collective/beskid/blob/main/README.md Clones the repository, syncs submodules, and installs dependencies using the setup script. ```bash git clone https://github.com/Cyber-Nomad-Collective/beskid.git cd beskid ./scripts/setup-environment.sh ``` -------------------------------- ### Pack then upload example Source: https://github.com/cyber-nomad-collective/beskid/blob/main/site/website/src/content/docs/book/reference/cli/commands/pckg.md Example demonstrating how to pack a package and then upload it. ```bash beskid pckg pack --package my-lib --source ./my-lib --output ./my-lib.bpk beskid pckg upload my-lib --artifact ./my-lib.bpk ``` -------------------------------- ### Examples Source: https://github.com/cyber-nomad-collective/beskid/blob/main/site/website/src/content/docs/book/reference/cli/commands/format.md Examples of how to use the beskid format command. ```bash # Print formatted source to stdout (one file only) beskid format src/Main.bd ``` ```bash # Rewrite in place beskid format src/Main.bd --write ``` ```bash # Same as format; format every .bd under src/ beskid fmt src --write ``` ```bash # CI: verify already-canonical sources (e.g. golden *.expected.bd) find tests/fixtures/format -name '*.expected.bd' -print0 | xargs -0 -I{} beskid format {} --check ``` -------------------------------- ### Example 1: Single-project app Source: https://github.com/cyber-nomad-collective/beskid/blob/main/site/website/src/content/docs/book/reference/projects/examples.md Directory structure for a single-project application. ```text MyApp/ ├── Project.proj └── Src/ └── Main.bd ``` -------------------------------- ### Pack a library project Source: https://github.com/cyber-nomad-collective/beskid/blob/main/site/website/src/content/docs/platform-spec/tooling/registry-client/pckg-client-contract/examples.mdx Produces a `.bpk` with `README.md`, sources, and `.beskid/docs/` when present. ```bash beskid pckg pack --project compiler/corelib/beskid_corelib/Project.proj ``` -------------------------------- ### Instantiate a template Source: https://github.com/cyber-nomad-collective/beskid/blob/main/site/website/src/content/docs/book/reference/projects/scaffolding.md Examples of instantiating templates from different sources. ```bash # Installed short name (auto-install from registry when online if needed) beskid new console -n MyApp -o ./MyApp # Registry package without prior install beskid new --package beskid.templates.lib --symbol name=MyLib -o ./MyLib # Local directory beskid new --path ./my-template -o ./Out # Git beskid new --git https://example.com/templates --git-ref main --git-subpath console -o ./App ``` -------------------------------- ### Repository config file Source: https://github.com/cyber-nomad-collective/beskid/blob/main/site/website/src/content/docs/platform-spec/tooling/registry-client/pckg-client-contract/examples.mdx Maps to registry aliases in `Workspace.proj`. ```json { "repositories": { "default": { "api_key": "..." } } } ``` -------------------------------- ### Verify installation Source: https://github.com/cyber-nomad-collective/beskid/blob/main/site/website/src/content/docs/book/01-it-works-on-my-machine/install-scripts-and-path.md After installing, open a new terminal and run these commands to verify the installation and check the version. ```bash which beskid beskid --version ``` -------------------------------- ### Console Controls Example Source: https://github.com/cyber-nomad-collective/beskid/blob/main/site/website/src/content/docs/platform-spec/core-library/terminal-and-console/console-controls/examples.mdx Example of building a Frame, Panel, and ProgressBar using Console API, and rendering it. ```beskid ConsoleSize size = Console.QuerySize(); // build Frame + Panel + ProgressBar per Controls API // frame.Render() → string written with System.Output.Write ``` -------------------------------- ### Instantiated console app (template output) Source: https://github.com/cyber-nomad-collective/beskid/blob/main/site/website/src/content/docs/platform-spec/tooling/manifests-and-lockfiles/project-manifest-contract/examples.mdx An example of a project manifest for a host project generated from a template. It includes basic project details and a target block for an application. ```text project { name = "MyApp" version = "0.1.0" root = "Src" } target "app" { kind = App entry = "Main.bd" } ``` -------------------------------- ### Troubleshooting install Source: https://github.com/cyber-nomad-collective/beskid/blob/main/site/website/src/content/docs/book/01-it-works-on-my-machine/troubleshooting-install.md Capture diagnostic information when stuck. ```bash which beskid beskid --version uname -a ``` -------------------------------- ### Example Usage Source: https://github.com/cyber-nomad-collective/beskid/blob/main/site/website/src/content/docs/book/reference/cli/commands/run.md Demonstrates how to use the 'beskid run' command with project and entrypoint arguments. ```bash beskid run --project path/to/Project.proj --entrypoint main ``` -------------------------------- ### Example module Source: https://github.com/cyber-nomad-collective/beskid/blob/main/site/website/src/content/docs/index.mdx An example of how to define and use modules in Beskid. ```beskid pub mod net.http; use net.http.Client; type ClientConfig { string endpoint, } Client make_client(ClientConfig config) { return Client { config: config }; } ``` -------------------------------- ### Example 2: App with local dependency Source: https://github.com/cyber-nomad-collective/beskid/blob/main/site/website/src/content/docs/book/reference/projects/examples.md Directory structure for an app with a local dependency. ```text Workspace/ ├── App/ │ ├── Project.proj │ └── Src/ │ └── Main.bd └── Std/ ├── Project.proj └── Src/ └── IO.bd ``` -------------------------------- ### Method Example Source: https://github.com/cyber-nomad-collective/beskid/blob/main/site/website/src/legacy-bridge/execution/ir-and-lowering/name-mangling.md Example of a mangled method signature. ```plaintext pn::net.http::Client::connect$method(self,Url,Result[str]) ``` -------------------------------- ### Function Example Source: https://github.com/cyber-nomad-collective/beskid/blob/main/site/website/src/legacy-bridge/execution/ir-and-lowering/name-mangling.md Example of a mangled function signature. ```plaintext pn::net.http::connect$function(i64,str,Result[str]) ``` -------------------------------- ### Template authoring (`beskid.templates.project`) Source: https://github.com/cyber-nomad-collective/beskid/blob/main/site/website/src/content/docs/platform-spec/tooling/project-scaffolding/project-templates/examples.mdx Manifest for the Beskid Template Package template. ```json { "schema": "beskid.template.v1", "identity": "beskid.templates.project::1.0.0", "name": "Beskid Template Package", "shortName": "template", "tags": { "type": "project" }, "symbols": { "name": { "type": "string", "isRequired": true }, "shortName": { "type": "string", "isRequired": true } }, "sources": [{ "source": "./content/", "target": "./" }] } ``` -------------------------------- ### Application host (app target) Source: https://github.com/cyber-nomad-collective/beskid/blob/main/site/website/src/content/docs/platform-spec/language-meta/composition/dependency-injection/examples.mdx Example of an application host with a registry for configuration and storage, and a startup method to open storage connections. ```beskid host AppHost(string[] args) : ConsoleHost { registry { single AppConfig for Configuration; single SqlStorage for Storage; single FileStorage for Storage; } startup(Configuration config, Storage[] storages) { for s in storages { s.Open(config); } } } type StorageAggregator { inject Configuration configuration; inject Storage[] storages; } unit main(string[] args) { launch AppHost(args); } ``` -------------------------------- ### Compiler Command Example Source: https://github.com/cyber-nomad-collective/beskid/blob/main/AGENTS.md Example of using 'beskid run' command. ```bash beskid run ``` -------------------------------- ### Generic Example Source: https://github.com/cyber-nomad-collective/beskid/blob/main/site/website/src/legacy-bridge/execution/ir-and-lowering/name-mangling.md Example of a mangled generic method signature. ```plaintext pn::collections::Map::insert$method(self,K,V,Option[V]) ```