{"id":24587269,"url":"https://github.com/drjayvee/gpio-cli","last_synced_at":"2025-03-17T19:16:53.337Z","repository":{"id":6067393,"uuid":"7293261","full_name":"drjayvee/gpio-cli","owner":"drjayvee","description":"Command line interface for RaspberryPi's GPIO","archived":false,"fork":false,"pushed_at":"2013-01-02T07:42:28.000Z","size":140,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-24T06:17:29.304Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drjayvee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-12-23T08:30:38.000Z","updated_at":"2013-10-17T19:49:49.000Z","dependencies_parsed_at":"2022-09-12T14:21:57.034Z","dependency_job_id":null,"html_url":"https://github.com/drjayvee/gpio-cli","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drjayvee%2Fgpio-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drjayvee%2Fgpio-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drjayvee%2Fgpio-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drjayvee%2Fgpio-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drjayvee","download_url":"https://codeload.github.com/drjayvee/gpio-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244094272,"owners_count":20397020,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2025-01-24T06:17:31.613Z","updated_at":"2025-03-17T19:16:53.304Z","avatar_url":"https://github.com/drjayvee.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GPIO-cli\n\n## About\nMany RaspberryPi users ask how to use GPIO without being root.\n\nThe short answer is that that's not possible.\n\nThe slightly longer answer is that GPIO really needs to be run as root.\nBut that doesn't mean your whole python program needs to be run as root. This python module provides a command line interface (CLI) to GPI, so you can call it from shell, like so:\n\n## Using GPIO from shell\n```\n# Set pin 13 to HIGH, get its value, then set to LOW\nsudo python gpiocli.py set 13 HIGH\nsudo python gpiocli.py get 13\nsudo python gpiocli.py set 13 LOW -q -v\nsudo python gpiocli.py cleanup\n```\n\n## Using it from python\n\n    import subprocess\n    subprocess.check_call([\"sudo\", \"python\", \"gpiocli.py\", \"set\", \"13\", \"HIGH\"])\n    subprocess.check_call([\"sudo\", \"python\", \"gpiocli.py\", \"get\", \"13\"])\n    # alternatively, depending on your shell environment\n    subprocess.check_call([\"sudo python gpiocli.py get 13\"], shell=True)\n\n## Why use sudo?\nIt's tempting to [use setuid](http://www.tuxation.com/setuid-on-shell-scripts.html) to make the module executable and run as root.\nHowever, that [doesn't work](http://stackoverflow.com/a/8314858)!\n\n## Make script executable\nSince the module starts with `#!/usr/bin/python`, you can `chmod +x` this script, and then run\n```\nsudo ./gpiocli.py 13 HIGH\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrjayvee%2Fgpio-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrjayvee%2Fgpio-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrjayvee%2Fgpio-cli/lists"}