Skip to content
This repository was archived by the owner on Dec 14, 2025. It is now read-only.
This repository was archived by the owner on Dec 14, 2025. It is now read-only.

Call a class based cocona app from within a blazor wasm app #166

@0xor1

Description

@0xor1

Is it possible to programmatically call a CoconaApp?, I use a class based approach shown below:

using Cocona;
using Common.Cli;
using Microsoft.Extensions.DependencyInjection;

var builder = CoconaApp.CreateBuilder();
builder.Services.AddLogging();
var app = builder.Build();
app.AddCommands<Api>();
app.AddCommands<I18n>();
app.AddCommands<Dnsk>();
await app.RunAsync();

I would like to be able to run a class based cocona app like this from within another program, not just call the command line from a different program, specifically I wanted to have a blazor wasm web app, that I will create my own terminal in the web page for the user to enter input into, then I can just pass the string the user inputs in my psuedo terminal and pass it to my cocona app programmatically within the wasm app, so I need to be bale to pass the string and presumably a delegate for the app to write output to my web ui.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions