Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dgtlntv committed Sep 29, 2024
1 parent ab3cc1f commit cfbe120
Show file tree
Hide file tree
Showing 6 changed files with 181 additions and 13 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Protostar
# Proto\*

Protostar is a tool that allows you to create interactive CLI prototypes using a simple JSON configuration file. It's designed to be easy to use, even for those with limited coding experience.
![](media/example.gif)
<small>A CLI prototype of a task manager.</small>

Proto\* is a tool for creating interactive CLI prototypes using a simple JSON configuration file. The tool generates a website that emulates a terminal, with only the CLI defined in the configuration file being available. It's designed for quick and easy creation of CLI prototypes, enabling rapid iterations.
The tool automatically deploys to GitHub Pages, allowing prototypes to be easily shared. This makes it suitable for user testing, as users can access the prototype through a simple link rather than having to install anything.

## Prerequisites

Expand Down
Binary file added media/example.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
179 changes: 172 additions & 7 deletions src/commands.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,186 @@
{
"$schema": "./commands-schema.json",
"welcome": "Welcome to the Enhanced CLI Prototype!\nType 'help' to get a list of all available commands.\n",
"welcome": "Welcome to TaskTrack CLI! Type 'help' to see available commands.",
"variables": {
"username": "unset",
"isLoggedIn": "false"
},
"commands": {
"register": {
"login": {
"description": "Log in to TaskTrack",
"handler": [
{
"component": "text",
"output": "Registering in progress...",
"component": "input",
"name": "username",
"message": "Enter your username:"
},
{
"component": "password",
"name": "password",
"message": "Enter your password:"
},
{
"component": "spinner",
"output": [
"Logging in",
"Please wait",
"Verifying credentials"
],
"duration": 2000
},
{
"component": "variable",
"output": {
"isLoggedIn": "true"
}
},
{
"component": "text",
"output": "Registered successfully"
"output": "Welcome, {{username}}! You are now logged in."
}
]
},
"logout": {
"description": "Log out from TaskTrack",
"handler": [
{
"component": "conditional",
"output": {
"if": "isLoggedIn == 'true'",
"then": [
{
"component": "spinner",
"output": "Logging out...",
"duration": 1000
},
{
"component": "variable",
"output": {
"username": "",
"isLoggedIn": "false"
}
},
{
"component": "text",
"output": "You have been logged out successfully."
}
],
"else": {
"component": "text",
"output": "You are not currently logged in."
}
}
}
]
},
"add": {
"description": "Add a new task",
"handler": [
{
"component": "conditional",
"output": {
"if": "isLoggedIn == 'true'",
"then": [
{
"component": "input",
"name": "taskName",
"message": "Enter task name:"
},
{
"component": "select",
"name": "priority",
"message": "Select task priority:",
"choices": [
{ "name": "Low", "value": "low" },
{ "name": "Medium", "value": "medium" },
{ "name": "High", "value": "high" }
]
},
{
"component": "progressBar",
"output": "Adding task...",
"duration": 1500
},
{
"component": "text",
"output": "Task '{{taskName}}' added with {{priority}} priority."
}
],
"else": {
"component": "text",
"output": "Please log in to add tasks."
}
}
}
]
},
"list": {
"description": "List all tasks",
"handler": [
{
"component": "conditional",
"output": {
"if": "isLoggedIn == 'true'",
"then": [
{
"component": "spinner",
"output": "Fetching tasks...",
"duration": 1000
},
{
"component": "table",
"output": [
["ID", "Task", "Priority", "Status"],
[
"1",
"Implement login",
"High",
"In Progress"
],
["2", "Create task list", "Medium", "Todo"],
[
"3",
"Add task prioritization",
"Low",
"Completed"
]
]
}
],
"else": {
"component": "text",
"output": "Please log in to view tasks."
}
}
}
]
},
"complete": {
"description": "Mark a task as complete",
"handler": [
{
"component": "conditional",
"output": {
"if": "isLoggedIn == 'true'",
"then": [
{
"component": "number",
"name": "taskId",
"message": "Enter the ID of the task to mark as complete:"
},
{
"component": "spinner",
"output": "Updating task status...",
"duration": 1500
},
{
"component": "text",
"output": "Task {{taskId}} has been marked as complete."
}
],
"else": {
"component": "text",
"output": "Please log in to update tasks."
}
}
}
]
}
Expand Down
1 change: 1 addition & 0 deletions src/io/yargs/commandsToYargs.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export default function commandsToYargs(yargs, config, localEcho) {
)
}
// Process subcommands recursively
// TODO subcommands is bugged
if (commandConfig.commands) {
Object.entries(commandConfig.commands).forEach(
([subCommandName, subCommandConfig]) => {
Expand Down
4 changes: 2 additions & 2 deletions src/io/yargs/componentsToYargsHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,14 @@ export default async function componentsToYargsHandler(

if (evaluatedCondition) {
await componentsToYargsHandler(
[component.output.then],
component.output.then,
argv,
localEcho,
globalVariables
)
} else if (component.output.else) {
await componentsToYargsHandler(
[component.output.else],
component.output.else,
argv,
localEcho,
globalVariables
Expand Down
2 changes: 0 additions & 2 deletions src/shims/readlineShim.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ class Interface {
}

function createInterface(options) {
console.log("bruh")

return new Interface(options)
}

Expand Down

0 comments on commit cfbe120

Please sign in to comment.