GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - atata-framework/atata-cli: C#/.NET library that provides an API for CLI and process execution

BranchesTags
Open more actions menu

Latest commit

 

History

184 Commits
184 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
test/Atata.Cli.IntegrationTests
test/Atata.Cli.IntegrationTests
 
 
.editorconfig
.editorconfig
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
Atata.Cli.slnx
Atata.Cli.slnx
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
Directory.Build.props
Directory.Build.props
 
 
Directory.Build.targets
Directory.Build.targets
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
azure-pipelines.codecoverage.runsettings
azure-pipelines.codecoverage.runsettings
 
 
azure-pipelines.release.yml
azure-pipelines.release.yml
 
 
azure-pipelines.runsettings
azure-pipelines.runsettings
 
 
azure-pipelines.yml
azure-pipelines.yml
 
 
en-US_User.dic
en-US_User.dic
 
 

Repository files navigation

Atata.Cli

NuGet GitHub release Build status Slack Atata docs X

Atata.Cli is a C#/.NET library that provides an API for CLI and process execution.

The package targets .NET 8.0 and .NET Framework 4.6.2.

Features

  • Provides an abstraction over System.Diagnostics.Process with CliCommand and ProgramCli classes.
  • Has ability to execute CLI through command shell: cmd, sh, bash, sudo, etc.
  • Provides synchronous and asynchronous API methods.
  • Works on Windows, Linux and macOS.

Installation

Install Atata.Cli NuGet package.

  • Package Manager:

    Install-Package Atata.Cli
    
  • .NET CLI:

    dotnet add package Atata.Cli
    

Usage

Execute command to get value

CliCommandResult result = new ProgramCli("dotnet")
    .Execute("--version");

string version = result.Output;

Execute command in directory

new ProgramCli("dotnet")
    .WithWorkingDirectory("some/path")
    .Execute("build -c Release");

Execute command through command shell

new ProgramCli("npm", useCommandShell: true)
    .Execute("install -g html-validate");

The default command shell for Windows is "cmd", for other OSs it is "sh".

Execute command through specific command shell

new ProgramCli("npm", new BashShellCliCommandFactory("-login"))
    .Execute("install -g html-validate");

or

new ProgramCli("npm")
    .WithCliCommandFactory(new BashShellCliCommandFactory("-login"))
    .Execute("install -g html-validate");

Set default shell CLI command factory

The default shell CLI command factory can be set in a global setup/initialization method.

Set for any operating system

ProgramCli.DefaultShellCliCommandFactory = new BashShellCliCommandFactory();

Set specific to operating system

ProgramCli.DefaultShellCliCommandFactory = OSDependentShellCliCommandFactory
    .UseCmdForWindows()
    .UseForOtherOS(new BashShellCliCommandFactory("-login"));

CLI command factories

There are several predefined classes that implement ICliCommandFactory:

  • DirectCliCommandFactory - executes the command directly. The default one.
  • CmdShellCliCommandFactory - executes the command through the Windows cmd shell program.
  • BashShellCliCommandFactory - executes the command through the Unix Bash shell program.
  • ShShellCliCommandFactory - executes the command through the Unix sh shell program.
  • SudoShellCliCommandFactory - executes the command through the Unix sudo shell program.
  • OSDependentShellCliCommandFactory - executes the command through one of the registered in it shell ICliCommandFactory instances depending on the current operating system.
  • UnixShellCliCommandFactory - executes the command through the specified Unix shell program.
  • ShellCliCommandFactory - base factory class that executes the command through the specified shell program.

Community

  • Slack: https://atata-framework.slack.com
  • X: https://x.com/AtataFramework
  • Stack Overflow: https://stackoverflow.com/questions/tagged/atata

Feedback

Any feedback, issues and feature requests are welcome.

If you faced an issue please report it to Atata.Cli Issues, ask a question on Stack Overflow using atata tag or use another Atata Contact way.

Contact author

Contact me, Yevhenii Shunevych, if you need help with test automation using the Atata Framework. You can hire me for test automation development or consulting if you are looking for a high-quality, maintainable automation solution for your project.

  • LinkedIn: https://www.linkedin.com/in/yevgeniy-shunevych
  • Email: [email protected]
  • Consulting: https://atata.io/consulting/

Sponsorship

Many thanks to the sponsors that regularly support the development of Atata Framework through donations:

  • Lombiq Technologies

If Atata Framework is useful to you or your company, consider supporting the framework development with a donation.

Contributing

Check out Contributing Guidelines for details.

SemVer

Atata Framework follows Semantic Versioning 2.0. Thus backward compatibility is followed and updates within the same major version (e.g. from 1.3 to 1.4) should not require code changes.

License

Atata is an open source software, licensed under the Apache License 2.0. See LICENSE for details.

About

C#/.NET library that provides an API for CLI and process execution

Topics

apiatatacli

Resources

Readme
Apache-2.0 license

Code of conduct

Code of conduct

Contributing

Contributing
Activity
Custom properties

Stars

3 stars

Watchers

1 watching

Forks

2 forks
Report repository

Releases

Sponsor this project

Used by

Contributors

Languages

Generated from atata-framework/atata-repository-template
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.