Creating a package extension using Pkg (rather than manually modifying Project.toml file)

I am developing a package (MyPackage) and have activated its environment with Pkg. I want to add an extension for when it is used together with someone else’s package (SomeoneElsesPackage). If I understand right, I could just manually modify the Project.toml file by adding:

SomeoneElsesPackage = "xxxxxxxxxxxxxxxxxxxxxxxxx"

SomeoneElsesPackageExtension = "SomeoneElsesPackage"

Is there some more “official” way of doing this? E.g. could I run ]extension ... or something?