ansicodes
rich-cli
ansicodes | rich-cli | |
---|---|---|
3 | 29 | |
66 | 2,949 | |
- | 0.7% | |
0.0 | 0.0 | |
about 2 years ago | about 2 months ago | |
HTML | Python | |
- | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
ansicodes
-
checkv4.js - Resource script
/** @param {NS} ns */ export async function main(ns) { //Defines colors to make print pretty :) //ANSII codes taken from https://ansi.gabebanks.net/ and improved upon with https://stackoverflow.com/questions/4842424/list-of-ansi-color-escape-sequences const colors = {red: "\x1b[38;5;160m", green: "\x1b[38;5;40m", yellow: "\x1b[38;5;226m", blue: "\x1b[38;5;33m", magenta: "\x1b[38;5;165m", cyan: "\x1b[38;5;123m", white: "\x1b[38;5;231m", def: "\x1b[38;5;10m", reset: "\x1b[0m"} if (ns.fileExists("targets.txt")) { //Reads targets file and turns them into an array const targets = ns.read("targets.txt").split(","); //Creates object with all the information we'll need from the server through map const tardata = targets.map(targetname => { const server = ns.getServer(targetname) ; return {hostname: targetname, money: server.moneyMax, root: server.hasAdminRights, backdoor: server.backdoorInstalled, ram: server.maxRam, portstoopen: server.numOpenPortsRequired - server.openPortCount}; }); //Sorts the object from most max money to least tardata.sort((a, b) => { return b.money - a.money; }); //Prints to console the list in order with all the necessary info. let i = 1; for (const target of tardata) { //This is probably the longest tprint I'll ever write. holy. ns.tprint(colors.green, i.toString().padStart(2, '0'), ": Hostname: ", colors.cyan, target.hostname.padEnd(18, " "), colors.green, " - Max Money: ", colors.cyan, target.money.toString().padEnd(18, " "), colors.green, " - root/backdoor: ", colors.cyan, target.root.toString().padStart(5, " "), colors.green, "/", colors.cyan, target.backdoor.toString().padEnd(5, " "), colors.green, " - Ram: ", colors.cyan, target.ram.toString().padStart(3, " "), "GB", colors.green, " - Ports To Open: ", colors.cyan, target.portstoopen.toString().padStart(2, " "), colors.reset); i++; } } else { ns.tprint("run createtargets.js '123321'"); } }
- I made a tool to generate ANSI escape codes, so you can easily add colors to your scripts.
rich-cli
- FLaNK Stack Weekly 12 February 2024
-
Ask HN: Programmers and Technologists in Scotland
I hope he doesn't mind, but the creator of Rich and Textualize is a good guy, and Scottish: https://www.willmcgugan.com/about/
https://www.textualize.io/
https://github.com/Textualize/rich
-
Code Feedback For OSINT Tool
You are using print statements too much. I understand the use due to it being a CLI application but still I suggest you look at textualize.
-
coBib 4.0: a modern UI using Textualize libraries
For more than a year I have been refactoring coBib, getting rid of its original ncurses-based TUI in favor of a more modern and a lot more maintainable textual-based TUI. Developing it has been a lot of fun and I must say that the team over at Textualize is doing a great job at developing libraries which are somehow very powerful and extensible while still being easy to use!
- Is anyone still making text user interfaces for end users?
-
Chatting with Will McGugan: From Side Project To Startup
Will McGugan is among the most well-known Python developers. He's the author of Rich, a library for formatting output in the terminal. It's used, among others, by pip, and has more than 40K stars on GitHub. In 2021, Will started building Textual, a TUI (text user interface) framework based on Rich. At the end of the year, he founded the company Textualize.
-
Building the Future of the Command Line
The future of the command line is something along the lines of what these guys are doing:
https://www.textualize.io
-
Textual is the only Python Terminal UI Framework you will need.
IF you ever wanted to build rich User Interfaces that work in the terminal with mouse support written in Python, then Textual is the Library for you.
-
Is Nim a good language to write Linux TUI applications?
If you change your mind about Python there's textual+rich, https://www.textualize.io/.
- Explaining Code Using ASCII Art
What are some alternatives?
ansis - Small and fast Node.js lib to colorize terminal output. Lightweight alternative to Chalk with more features. Supports Bun, Deno, Next.JS.
bat - A cat(1) clone with wings.
terminology - An intuitive way to color terminal text with python
rich - Rich is a Python library for rich text and beautiful formatting in the terminal.
fzf - :cherry_blossom: A command-line fuzzy finder
PageCrypt - Client-side password-protection for HTML
textual - The lean application framework for Python. Build sophisticated user interfaces with a simple Python API. Run your apps in the terminal and a web browser.
term-keys - Lossless keyboard input for Emacs
pls - `pls` is a prettier and powerful `ls(1)` for the pros.
exa - A modern replacement for ‘ls’.