Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CLI for basic requests #46

Open
sochotnicky opened this issue Nov 12, 2020 · 1 comment · May be fixed by #51
Open

Add CLI for basic requests #46

sochotnicky opened this issue Nov 12, 2020 · 1 comment · May be fixed by #51
Milestone

Comments

@sochotnicky
Copy link

sochotnicky commented Nov 12, 2020

So - I have written a thin wrapper around this library which can be used on a command line:
https://gist.github.com/sochotnicky/101e3b2bbcdddd5db065d0ff102d3db2

For example:

$ python obs-cli.py ListSceneCollections
{
    "scene-collections": [
        {
            "sc-name": "Demo - Share Left"
        },
        {
            "sc-name": "Demo - Share Right"
        },
        {
            "sc-name": "Share - WebCam"
        },
        {
            "sc-name": "Untitled"
        }
    ]
}
$ python obs-cli.py SetCurrentSceneCollection Untitled
{}

The way it's done it does not require changes when methods are added. I am sure there's things that do not work well - it would be nice for example if there were annotations on arguments that could be used to figure out expected argument types etc.

I was considering creating a separate repo for it & putting it there, but I figure maybe it could be more useful included here? If you'd be up for the idea - I can open a PR (it would need additional changes to setup.py etc to install the script)

@Elektordi
Copy link
Owner

Hello,

Good idea! Yes, you can do a PR for this!

Best regards,

sochotnicky pushed a commit to sochotnicky/obs-websocket-py that referenced this issue Dec 6, 2020
This adds a basic CLI utility that uses introspection to get all
possible commands and enables running them from console.

It also provides way to specify complex JSON arguments if needed.

Fixes Elektordi#46
sochotnicky pushed a commit to sochotnicky/obs-websocket-py that referenced this issue Dec 6, 2020
This adds a basic CLI utility that uses introspection to get all
possible commands and enables running them from console.

It also provides way to specify complex JSON arguments if needed.

Fixes Elektordi#46
@sochotnicky sochotnicky linked a pull request Dec 6, 2020 that will close this issue
sochotnicky pushed a commit to sochotnicky/obs-websocket-py that referenced this issue Dec 6, 2020
This adds a basic CLI utility that uses introspection to get all
possible commands and enables running them from console.

It also provides way to specify complex JSON arguments if needed.

Fixes Elektordi#46
sochotnicky pushed a commit to sochotnicky/obs-websocket-py that referenced this issue Dec 6, 2020
This adds a basic CLI utility that uses introspection to get all
possible commands and enables running them from console.

It also provides way to specify complex JSON arguments if needed.

Fixes Elektordi#46
sochotnicky pushed a commit to sochotnicky/obs-websocket-py that referenced this issue Dec 6, 2020
This adds a basic CLI utility that uses introspection to get all
possible commands and enables running them from console.

It also provides way to specify complex JSON arguments if needed.

Fixes Elektordi#46
@Elektordi Elektordi added this to the 0.6 milestone Dec 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants