{"id":18866737,"url":"https://github.com/manavalan2517/cli-pastes","last_synced_at":"2026-05-08T17:36:42.126Z","repository":{"id":232103671,"uuid":"783329938","full_name":"Manavalan2517/Cli-Pastes","owner":"Manavalan2517","description":"This script allows users to create, view, and manage text pastes. It provides a simple command-line interface for creating new pastes and viewing existing ones.","archived":false,"fork":false,"pushed_at":"2024-04-08T01:33:16.000Z","size":5701,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-30T14:36:24.889Z","etag":null,"topics":["cli","cli-paste","json","note","notes","pasteboard","pastes","python","terminal","text"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Manavalan2517.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-04-07T15:37:02.000Z","updated_at":"2025-01-09T19:46:15.000Z","dependencies_parsed_at":"2024-04-08T02:53:53.294Z","dependency_job_id":null,"html_url":"https://github.com/Manavalan2517/Cli-Pastes","commit_stats":null,"previous_names":["manavalan2517/cli-pastes","manavalan-v/cli-pastes"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Manavalan2517/Cli-Pastes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Manavalan2517%2FCli-Pastes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Manavalan2517%2FCli-Pastes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Manavalan2517%2FCli-Pastes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Manavalan2517%2FCli-Pastes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Manavalan2517","download_url":"https://codeload.github.com/Manavalan2517/Cli-Pastes/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Manavalan2517%2FCli-Pastes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32790720,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","cli-paste","json","note","notes","pasteboard","pastes","python","terminal","text"],"created_at":"2024-11-08T05:07:22.827Z","updated_at":"2026-05-08T17:36:41.918Z","avatar_url":"https://github.com/Manavalan2517.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CLI - Paste\r\n\r\n\r\n\r\nhttps://github.com/Manavalan2517/Cli-Pastes/assets/112639423/92b48edd-201c-415b-a7a0-195db9281a30\r\n\r\n\r\n\r\n\u003e ` It is Inspired from ( https://github.com/codemyst/pastemyst )`\r\n\r\n# A simple Python script to create and manage text pastes.\r\n\r\n## Introduction\r\nThis script allows users to create, view, and manage text pastes. It provides a simple command-line interface for creating new pastes and viewing existing ones.\r\n\r\n### Commands Used:\r\n\r\n- `create`: Create a new paste.\r\n- `view`: View an existing paste.\r\n- `exit`: Exit the script.\r\n\r\n\r\n## Modules Used:\r\nThe script imports several modules including \r\n1. `json` -----------\u003e `for parsing and generating JSON data`\r\n2. `platform` ------\u003e `to access underlying platform’s identifying data`\r\n3. `os` --------------\u003e `for a portable way of using operating system dependent functionality`\r\n4. `rich.console`-\u003e `enables rich text and beautiful formatting in the terminal`\r\n5. `rich.syntax`--\u003e `allows syntax highlighting of code snippets`\r\n6. `questionary`--\u003e `for creating interactive prompts and questionnaires`\r\n7. `pyperclip`----\u003e `access to the clipboard for copying and pasting`\r\n8. `random`-------\u003e `used for generating random numbers and selecting random elements`\r\n9. `string`-------\u003e `provides a collection of string constants, useful for generating random strings`\r\n\r\n## Working\r\n1. The script checks if a `JSON` file named 'UserData.json' exists. \r\n\u003e\r\n2. If it doesn't exist, it creates a new one and stores the user's operating system information in it. \r\n\u003e\r\n3. The script also defines a function 'update_json' that updates the user's data in a JSON file named 'data.json'.\r\n\u003e\r\n4. The script then enters a while loop that prompts the user to select an action: create, view, or exit. \r\n\u003e\r\n5. If the user selects 'create', the script prompts for confirmation, paste name, and checks the user's operating system. \r\n\u003e\r\n6. If the operating system is Windows, it creates an empty text file, opens it with notepad, reads the entered data, and stores it in a variable 'pdData'. \r\n\u003e\r\n7. The script then generates a unique ID and checks if it already exists in the 'data.json' file. \r\n\u003e\r\n8. If it doesn't exist, it updates the JSON file with the paste name, ID, and data, and removes the temporary text file.\r\n\u003e\r\n9.  If the user selects 'view', the script prompts for an ID and checks if it exists in the 'data.json' file. \r\n\u003e\r\n10. If it exists, it prints the paste content using the rich.syntax module, prompts the user to copy the content to the clipboard, and copies it if requested.\r\n\u003e\r\n11. If the user selects 'exit', the script breaks out of the while loop and terminates.\r\n\u003e\r\n12. If an unknown command is entered, the script prints a message to try again.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanavalan2517%2Fcli-pastes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanavalan2517%2Fcli-pastes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanavalan2517%2Fcli-pastes/lists"}