Thanks to visit codestin.com
Credit goes to github.com

Skip to content

HunterRundhaug/OpenCli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenCli

OpenCli is a C#/.NET terminal assistant that lets you interact with the OpenAI API from the command line.

The goal of this project is to practice .NET fundamentals while building a useful developer-focused CLI tool. The app currently supports interactive chat mode, one-shot questions, and reading local files so their contents can be sent to the AI.

Project Goals

This project is meant to help me learn and practice:

  • C# and .NET project structure
  • Building command-line applications
  • Separating CLI code from core logic
  • Async/await and Task<T>
  • Calling external APIs
  • Managing environment variables safely
  • Reading files from the command line
  • Writing unit tests with xUnit
  • Designing simple classes and interfaces
  • Using dependency injection to avoid calling real APIs in tests

Current Features

  • Interactive terminal chat mode
  • One-shot ask command
  • File reading command read file for sending local file contents to the AI
  • Conversation tracking with user and assistant messages
  • OpenAI API integration
  • Fake message client for testing without using API tokens
  • Basic xUnit tests for core chat behavior

Planned Features

  • Better file review prompts
  • Compiler error explanation command
  • Saved chat history
  • Prompt profiles, such as C# tutor or code reviewer
  • Full conversation context sent to the API
  • Streaming responses
  • Markdown output files
  • Support for multiple input files

Project Structure

OpenCli/
  OpenCli.Cli/
    Program.cs
    TerminalApp.cs

  OpenCli.Core/
    Message.cs
    Conversation.cs
    ChatSession.cs
    IMessageClient.cs
    MessageClient.cs

  OpenCli.Tests/
    ConversationTests.cs
    ChatSessionTests.cs
    MessageClientTests.cs

About

A C#/.NET terminal assistant that connects to the OpenAI API and supports interactive chat, one-shot questions, and file-based prompts. Built to practice CLI design, async API calls, file handling, project structure, and testable core logic.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages